Solved

Windows Logon Batch File

Posted on 2011-02-22
8
466 Views
Last Modified: 2012-05-11
i have just switched from a windows 2000 to windows 2008sb server.

on a couple of laptops i had a log on script batch file which ran on start up - it prompted the user for username/password on the 2000 server.............it reads as follows:

@echo off
net time \\server10 /set /yes
net use J: \\server10\Usershares2`      
net use I: \\server10\Setup
net use x: \\server10\hotel
net use w: \\server10\Artwork

When i try to point the same script (changing the server10 name) at the new server the script does not work.

does the script need to be modified for windows 2008 server?
0
Comment
Question by:VSFLYER
  • 4
  • 3
8 Comments
 
LVL 37

Expert Comment

by:Neil Russell
ID: 34951653
Have you created all those shares on the new server and given access rights to all the users that need them?

Your Net Time command is not needed, time will be taken from your domain.
0
 
LVL 83

Expert Comment

by:oBdA
ID: 34951669
First, forget about "net time"; it's deprecated, users don't have permissions to change the time, and all Windows OSs since W2k have a time service that automatically syncs the time in a domain.
Then you might have to delete the old mappings, depending on whether the existing mappings are persistent or not.

@echo off
net use J: /delete >NUL 2>&1
net use J: \\server10\Usershares2`      
net use I: /delete >NUL 2>&1
net use I: \\server10\Setup
net use X: /delete >NUL 2>&1
net use x: \\server10\hotel
net use W: /delete >NUL 2>&1
net use w: \\server10\Artwork

Open in new window

0
 

Author Comment

by:VSFLYER
ID: 34951680
shares are all set up on the new server

the batch file should ask the user to enter username and password and allow access based on those entries.

linked to the new server, the batch file is no longer requesting a username/password and simply connecting the users to the drives which everyone has access to.
0
 
LVL 83

Accepted Solution

by:
oBdA earned 500 total points
ID: 34951743
Any specific reason why user name and password need to be specified explicitly?
Here's a rough draft:
@echo off
setlocal
set Server=Server10
set /p UserID=Please enter the user name to access %Server%: 
for %%a in (I J W X) do (
  net use %%a: /delete >NUL 2>&1
)
net use J: "\\%Server%\Usershares2" * /user:"%UserID%"
net use I: \\%Server%\Setup
net use X: \\%Server%\hotel
net use W: \\%Server%\Artwork

Open in new window

0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:VSFLYER
ID: 34951817
the name and password need to be specified explicitly as that is what identifys what folders to allow access to.
0
 
LVL 83

Expert Comment

by:oBdA
ID: 34951862
Are the users logging on to local accounts on the laptops instead of domain accounts?
0
 

Author Comment

by:VSFLYER
ID: 34951927
set up is as follows we had a server SERVER02 - some laptop users used the log-on batch file orginally noted above - this prompted them for a username and password, once the username and apssword were entered the script closed and the users we able to access their directories on the server.

i have now got a new server SERVER10 - i attempted to use the same log-on batch file however the script does not prompt for the username, just connects to the drives and allows only access to those folders marked on the server for everybody acccess.
0
 
LVL 83

Expert Comment

by:oBdA
ID: 34951954
Try the script in http:#a34951743 then. If it works, the error handling can be enhanced.
0

Featured Post

Too many email signature changes to deal with?

Are you constantly being asked to update your organization's email signatures? Do they take up too much of your time? Wouldn't you love to be able to manage all signatures from one central location, easily design them and deploy them quickly to users. Well, you can!

Join & Write a Comment

The password reset disk is often mentioned as the best solution to deal with the lost Windows password problem. In Windows 2008, 7, Vista and XP, a password reset disk can be easily created. But besides Windows 7/Vista/XP, Windows Server 2008 and ot…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now