I am looking to write a little snippet of code that would look like
the following pseudocode. Does anyone know how this can be done?
if network drive exists (z: and y:) then
remove network drives
re-map them to new UNC path
else
map to UNC path
End if
I use the DriveExists method of the FileSystemObject. In brief:
============
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objNetwork = CreateObject("Wscript.Network")
If (objFSO.DriveExists("H:") = True) Then
objNetwork.RemoveNetworkDrive "H:", True, True
End If
objNetwork.MapNetworkDrive "H:", "\\MyServer\MyShare"
==========
I do something similar in the MapDrive function in this example VBScript
logon script:
http://www.rlmueller.net/Logon3.htm
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--