ClulessChris
IS-IT--Management
I've tried useing WshNetwork.RemoveNetworkDrive, WshNetwork.MapNetworkDrive, Shell('net use Y:'), and ShellWait to map drives with similar results.
Works when stepped through but fails (too disconnect the old drive) in run time.
I thought that the code was just too fast and have tried using sleep to slow it down, but to no avail.
Can you help?
Never knock on Death's door: ring the bell and run away! Death really hates that!
Works when stepped through but fails (too disconnect the old drive) in run time.
I thought that the code was just too fast and have tried using sleep to slow it down, but to no avail.
Can you help?
Code:
' Call ShellWait("net use Y: /d")
' Call Shell("net use Y: " & SharePath)
Dim WshNetwork As Object
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.RemoveNetworkDrive "Y:"
Sleep (2000)
WshNetwork.MapNetworkDrive "Y:", SharePath
Set WshNetwork = Nothing
Never knock on Death's door: ring the bell and run away! Death really hates that!