On Error Resume Next
Set objNetwork = Wscript.CreateObject("WScript.Network")
' Check to see if the drives exist
objNetwork.RemoveNetworkDrive "Y:"
objNetwork.RemoveNetworkDrive "Z:"
WScript.Sleep 2000
Set strUser = InputBox("Enter User Name:", "User Name", "username")
Set strPassword = InputBox("Enter Password:", "Password", "Password")
'Map Drives
objNetwork.MapNetworkDrive "Y:", "\\server\share", False, strUser, strPassword
objNetwork.MapNetworkDrive "Z:", "\\server\share2", False, strUser, strPassword
|