0

I've got a weird problem, (like always :p )

Okay: Situation: Windows 2003 domain with XP clients. With a GPO I'm running a VBS script on login to map a few drives. This works great on XP, but not on Vista. If I manually run the script after the user has logged on, it works. So I know the script works on Vista, it just doesn't run via the GPO. The user has admin privileges.

I also have the same problem on Windows 7 RC1. So it must be related.

The script:

 on error resume next
Dim objNetwork
Dim strDriveLetter, strRemotePath, strUserName
strDriveLetter = "Z:"
strRemotePath = "\\Onsgeluk.ons_geluk.local\Profieldoc"
Set objNetwork = WScript.CreateObject("WScript.Network")
strUserName = objNetwork.UserName
objNetwork.RemoveNetworkDrive "Z:"
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath _
& "\" & strUserName
objNetwork.RemoveNetworkDrive "X:"
objNetwork.MapNetworkDrive "X:" , "\\Onsgeluk.ons_geluk.local\Data"
objNetwork.RemoveNetworkDrive "Y:"
objNetwork.MapNetworkDrive "Y:" , "\\Onsgeluk.ons_geluk.local\Mappen\hoofdverpleging"

Does anyone have a clue?

Thanks in advance guys (and girls)

ps: sorry for my bad english!

LapTop006
  • 6,496
  • 20
  • 26
The_cobra666
  • 167
  • 1
  • 3
  • 12

1 Answers1

4

Your script is running fine.

Because your Vista users are Administrators and because you have User Account Control enabled the users' filtered token, under which Explorer runs, doesn't have access to the "drives" that were "mapped" when the logon script ran.

You have two choices:

Evan Anderson
  • 141,881
  • 20
  • 196
  • 331
  • +1 "too difficult for most people to handle" [chuckle] – squillman Sep 09 '09 at 14:34
  • Thanks, I'm going to try your suggestion out tomorrow, looks like a winner! – The_cobra666 Sep 09 '09 at 16:06
  • Welcome to UAC! Much as it's heart is in the right place, playing nicer in a Domain environment would have been a preferable approach (but that's another topic more appropriate to elsewhere). – Maximus Minimus Sep 09 '09 at 17:02
  • 1
    @squillman: >smile< It blows my mind that limited user accounts are still so "taboo". I've been putting Windows NT-based machines on desks with limited user accounts since Windows NT Workstation 4.0. It's not rocket scienece. You figure out what it takes to make your apps work (registry, file permissions, etc) and you make them work. If they absolutely won't work w/o "Administrtor" rights then you use RunAs and a dedicated account (thanks, W2K!) or you get a new app. Case closed. I can't understand why people can't just deal with it. This isn't new. – Evan Anderson Sep 09 '09 at 17:56
  • @mh: We haven't had any problems with UAC, but then virtually no users at our Customer sites ever run as "Administrator", even in Vista. – Evan Anderson Sep 09 '09 at 17:56
  • Actually, I've got no option. The user needs administrator rights to run the accounting program (which of course sucks like hell), but there's no alternative. Other users indeed, do not have administrator rights. I'm not stupid... – The_cobra666 Sep 10 '09 at 07:12
  • @The_cobra666: I didn't mean to imply anything offensive. It's a touchy issue with me, I guess, because of the sheer number of headaches and countless wasted dollars that I've seen going into issues caused by users having excessive rights. My apologies for being abrasive. I would love to hear what the accounting app is. I'm guessing that it could be "coaxed" into not needing excessive rights. – Evan Anderson Sep 11 '09 at 00:53
  • No offense taken Evan, just had a bad day then :) The software is Geracc and "Isabel" for accounting. Now that last program is one rubbish written app! Thanks for the tips ;) – The_cobra666 Nov 03 '09 at 09:54