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
If (IsMember("STUDENTS") = TRUE) Then
	strUNCPath = "\\server1\students$\" & strUserName
	Wscript.echo "You are logged in with a Student account"
	strUNCPath = "\\server2\STAFF$\" & strUserName
	Wscript.echo "You are logged in with a Staff account"
End If
Sub subMappingRoutine
objNetwork.MapNetworkDrive strDriveLetter, strUNCPath
End Sub

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
PURIM-EAuthor Commented:
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.
so that means either you have a permissions issue or there really isn't a path that equals whatever ' "\\server1\students$\" & strUserName' is.  If you log in as a student and attempt to map a drive to that location, it should give you the same error.  Without knowing the setup of your network, i'd have to guess it's either permissions or something to do with \\server1\students$\" & strUserName not being a valid UNC link (ie, the path is wrong).

If you have a test student account you should be able to simulate this and figure out where everything is failing.  I'd start by giving the test account full admin rights on the box with those shares on it and see if that helps.  if it doesn't, log into the box and try to map the drive by hand.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PURIM-EAuthor Commented:
Thanks... you were right - I was missing a directory off the path
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.