• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 477
  • Last Modified:

Windows Logon Batch File

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
VSFLYER
Asked:
VSFLYER
  • 4
  • 3
1 Solution
 
Neil RussellTechnical Development LeadCommented:
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
 
oBdACommented:
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
 
VSFLYERAuthor Commented:
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
oBdACommented:
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
 
VSFLYERAuthor Commented:
the name and password need to be specified explicitly as that is what identifys what folders to allow access to.
0
 
oBdACommented:
Are the users logging on to local accounts on the laptops instead of domain accounts?
0
 
VSFLYERAuthor Commented:
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
 
oBdACommented:
Try the script in http:#a34951743 then. If it works, the error handling can be enhanced.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now