General discussion


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.

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:


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


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

Related Discussions

Related Forums