script to change drive/server location

Soldato
Joined
12 Jun 2012
Posts
3,918
Location
West Yorkshire
Hi guys.

Replacing a fileserver and instead of having to go around 100 peoples computers and manually change the server the files are on, is there a script you guys use to change these automatically via a batch file?

All the file locations will be the same just the \\servername\location\filename will be different.

Thanks.
 
Associate
Joined
19 Jul 2006
Posts
1,847
Would something as simple as

net use X: /delete /y
net use x: \\servername\location be of use? where x is the mapped letter drive on the computer.

the first line should remove the map the second should add it.

We use something similar in our start up script on the Domain controler.
Should be in the sysvol file if i remember correctly
 
Soldato
OP
Joined
12 Jun 2012
Posts
3,918
Location
West Yorkshire
Would something as simple as

net use X: /delete /y
net use x: \\servername\location be of use? where x is the mapped letter drive on the computer.

the first line should remove the map the second should add it.

We use something similar in our start up script on the Domain controler.
Should be in the sysvol file if i remember correctly

This is what i was looking at although no every drive letter is the same.

Is there a way to use the script to search the \\drivename ?
 
Back
Top Bottom