Discussion Locked

batch files

0 helpful
10 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How do you create batch files for users to map to to various drives on the server automatically

10 replies

by syscokid

Create a file called logon.bat in the netlogon share of your server.

In the bat file map the drives

net use q: \\servername\sharename

In User Manager for Domains specify that each user is to run logon.bat.

by nitemare

Hi,

For a single user, open notepad and type something like:-

net use x: \\server\share
where x: is a logical drive letter.
net use x: \\server\share /persistent:yes
if you want to make it permanent.

do that for all drives, printers etc then save the file and put it in the startup folder in the users profile. This will load it each time. You don't need to do that if you use the persistent flag though.

To do drive mapping batch's for a group of users, put the batch file(s) on yourlogon server and point them to the files through User Manager.

Regards,

by rsp

Expanding on these answers slightly, because permanent connections can fail, I'd run the batch file every time, but as follows:

net use q: /delete
net use q: \\servername\sharename

If you don't want the users to see what's happening, put the following at the end of each command:

>nul 2>&1

As in the other answers, place this in a share somewhere and point the user's logon script in User Mangler to it.

Richard

by nettek

While people told you how to write the batch file, no one told you where to put it. You must place login scripts in the following hidden share of your domain controllers:
\winnt\system32\repl\import\scripts

This discussion is closed to new replies.