How to delete old mapped drive and map new ones in logon script?

Cooky

Golden Member
Apr 2, 2002
1,408
0
76
We just moved some data from old servers to the new ones, and now needs to map all the mapped drives on them.
Obviously we don't want to go over to every single user's PC and do it.

What's the syntax to delete the old mapped drive and map new ones in logon script using the same drive letter?

I remember seeing a thread about it on this forum before but can't find it using the search function.
 

JRock

Platinum Member
Apr 19, 2001
2,742
0
0
Type net use x: /delete, where x: is the drive letter of the shared resource
 

Cooky

Golden Member
Apr 2, 2002
1,408
0
76
Thanks for the reply.

This is what I have in my logon script:
net use k: \\OldServer\FolderName /delete /yes
net use k: \\NewServer\FolderName

The original k: was mapped manually from the PC. We're trying to get rid of it, and then remap to the new server.
When I logon, I still have k: mapped to the old server.

Any suggestions?
 

kevnich2

Platinum Member
Apr 10, 2004
2,465
8
76
Try looking at the data in it and it's probably on the new server. For some reason if you just switch the drive letter to a different location, it retains the same name but the connection is still correct. So try opening up that drive letter and actually looking at the data to make sure it's the new server.
 

Fardringle

Diamond Member
Oct 23, 2000
9,200
765
126
Originally posted by: Cooky
Thanks for the reply.

This is what I have in my logon script:
net use k: \\OldServer\FolderName /delete /yes
net use k: \\NewServer\FolderName

The original k: was mapped manually from the PC. We're trying to get rid of it, and then remap to the new server.
When I logon, I still have k: mapped to the old server.

Any suggestions?

Including the old server and share name in the first net use statement, you are telling Windows to map the K: drive to that location. Use this instead:

net use k: /delete /yes
net use k: \\NewServer\FolderName

 

JRock

Platinum Member
Apr 19, 2001
2,742
0
0
try just using

net use k: /d

net use k: \\newserver\foldername