General discussion

Locked

Login Scripts

By Michael34 ·
I have a quick question. Is there a way in DOS that when I create a mapped network drive and save it to a bat file that I can instruct it to be a temp mapped drive? The problem I am having is when a user logs in to our domain it runs the bat file and comes up with errors saying the drive already exsists, as when the script it ran for the first time and the drives don't exsist it the script works great.

Here is how our script looks. Is there anything I can add to make it only a temp one so when the user loggs off it will unmap it and not reconnect at login?

net use I: \\Server02\Apps
net use J: \\Server02\Acct

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by Joseph Moore In reply to Login Scripts

In the BAT file, put this line in first, before you start mapping drives:

NET USE * /D /Y


That will DISCONNECT all mapped drives that exist. THEN you run the other Net Use lines to map drive I and J like you posted.

Collapse -

by ctmoore1998 In reply to Login Scripts

Just remove the mappings by adding the following at the beginning of your script
NET USE I: /D /Y
NET USE J: /D /Y

OR
NET USE * /D /Y

These will end any share then your batch can recreate them with the net use commands that you have.

Collapse -

by Arne.Tredal In reply to Login Scripts

To make the mapping "temp mapped" use;
net use I:\\Server02\Apps /Persistent:NO
net use I:\\Server02\Acct /Persistent:NO

Back to Windows Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums