Forum Home
Press F1
 
Thread ID: 64939 2006-01-02 11:36:00 basic network scripts???? aidanmaz (7180) Press F1
Post ID Timestamp Content User
417746 2006-01-02 11:36:00 server 2003

have multiple users who will connect to server, i want them to be able to have mapped drives upon logon

first drive D$\applications ($ cos its a logical drive) share name FS1
\\server\FS1

Second Drive D$\System files share name: FS2
\\server\FS2
server name: server
and printer is HP deskjet 840c share name HP (\\serve
r\HP)
i was reading MS website and the logon script area really confused me, i found this:
Set WshShell = WScript.CreateObject( " WScript.Shell " )
Set WshNetwork = WScript.CreateObject( " WScript.Network " )
Set AllDrives = WshNetwork.EnumNetworkDrives()
DriveLetter = " N: " 'must be capitalized
RemotePath = " \\dave\c "
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

but subsititing doesnt work.....any help????
aidanmaz (7180)
417747 2006-01-02 21:04:00 That is a weird script. It's enumerating every other drive: "For i = 0 To AllDrives.Count - 1 Step 2"

If you just want to map network drives, just use a CMD or BAT file, and the "NET USE" command

Start run...CMD
NET USE /? [help]
NET USE [display all map drives]
NET USE X: /DELETE
NET USE X: \\SERVER\FS1 /PERSISTENT:YES
kingdragonfly (309)
1