PURIM-E
asked on
Error when trying to map a drive in a log on vb script
Hi, I have a vb script log on script which I am calling from Group Policy and running on Vista Clients. I get the following error when trying to map a network drive in the script:
"The specified network resource or device is no longer available."
Please see attached code... your help would be appreciated, thanks
"The specified network resource or device is no longer available."
Please see attached code... your help would be appreciated, thanks
If (IsMember("STUDENTS") = TRUE) Then
strUNCPath = "\\server1\students$\" & strUserName
subMappingRoutine
Wscript.echo "You are logged in with a Student account"
Else
strUNCPath = "\\server2\STAFF$\" & strUserName
subMappingRoutine
Wscript.echo "You are logged in with a Staff account"
End If
Sub subMappingRoutine
objNetwork.MapNetworkDrive strDriveLetter, strUNCPath
End Sub
can the accounts your running that logon script against access those hidden shares on thier own? That isn't a vbscript error, that's a windows error. You'd get the same error if you tried a net use command instead of using WSH/VBS.
ASKER
OK... so how do I map the network drive (home area) in a script ? The script works fine when I log on with a staff account (ELSE statement) but not if I log on as a student account.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks... you were right - I was missing a directory off the path