I'm trying to check if a drive exists, if it does I need to remove it and rename as the old name sticks for some reason. This is what I have right now:
it changes the path but the old name stays for some reason - any ideas?
Set objFSO = CreateObject("Scripting.FileSystemObject")Set objNetwork = CreateObject("Wscript.Network")
if objFSO.folderexists("O:") then
objNetwork.RemoveNetworkDrive "O:", True, True
objNetwork.MapNetworkDrive "O:", "\\srv-fs\shares"
set renameShell = createObject("shell.application")
mappedDrive = "O:\"
renameShell.nameSpace(mappedDrive).self.name = "Shares (\\srv-fs-shares)"