RemoveNetworkDrive with wildcards
Posted on 2004-08-19
Removing a network drive is easy enough. I would like to disconnect all mapped drives, then remap them in a login script. I would preferr not to have to have a line for each drive letter that exist. I thought there might be a way to use a wildcard in this. I like to keep things simple an short. Below is the script I am working from, nothing fancy.
on error resume next
Set WshNetwork = WScript.CreateObject("WScript.Network")
WshNetwork.MapNetworkDrive "F:", "\\server\share"
WshNetwork.MapNetworkDrive "M:", "\\server\share"
WshNetwork.MapNetworkDrive "N:", "\\server\share"