Re: Login script mapped drvs show up disconnected
From: Chris Jones (cka691_at_alltel.net)
Date: 02/01/05
- Next message: Ralph Richey: "bringing the server up"
- Previous message: David Rodriguez: "Is there a way to automate ICW, maybe a script?"
- In reply to: Jalexander01: "Login script mapped drvs show up disconnected"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 1 Feb 2005 11:53:47 -0500
I think there is a problem with net use if drives are already mapped or
connected, I use a script here are the entries.... Try this and tell me how
it works, you can create this script with notepad, name it something.vbs,
then call on it with login bat file in Sysvol folder.
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set AllDrives = WshNetwork.EnumNetworkDrives()
DriveLetter = "Z:" 'must be capitalized
RemotePath = "\\Svr01\SEALS"
AlreadyConnected = False
For i = 0 To AllDrives.Count - 1 Step 2
If AllDrives.Item(i) = DriveLetter Then AlreadyConnected = True
Next
If AlreadyConnected = False then
WShNetwork.MapNetworkDrive DriveLetter, RemotePath
WshShell.PopUp "Drive " & DriveLetter & " connected successfully."
Else
WShNetwork.RemoveNetworkDrive DriveLetter
WshShell.PopUp "Drive " & DriveLetter & " disconnected."
End if
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set AllDrives = WshNetwork.EnumNetworkDrives()
DriveLetter = "X:" 'must be capitalized
RemotePath = "\\Svr01\inactive"
AlreadyConnected = False
For i = 0 To AllDrives.Count - 1 Step 2
If AllDrives.Item(i) = DriveLetter Then AlreadyConnected = True
Next
If AlreadyConnected = False then
WShNetwork.MapNetworkDrive DriveLetter, RemotePath
WshShell.PopUp "Drive " & DriveLetter & " connected successfully."
Else
WShNetwork.RemoveNetworkDrive DriveLetter
WshShell.PopUp "Drive " & DriveLetter & " disconnected."
End if
- Next message: Ralph Richey: "bringing the server up"
- Previous message: David Rodriguez: "Is there a way to automate ICW, maybe a script?"
- In reply to: Jalexander01: "Login script mapped drvs show up disconnected"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|