Startup script on computers doesn not work via group policy - TechRepublic
Question
September 2, 2009 at 01:13 PM
ikram.hussain

Startup script on computers doesn not work via group policy

by ikram.hussain . Updated 16 years, 9 months ago

I have a batch file and vbscript for mapping a network drive, which I am using in the GPO and it doesn’t work.

In Active Directory Users and Computers, I have an OU, I right click on the OU and go to properties and select the Group Policy tab, and create a new policy by a name test.

Then click Edit on that test policy and go to the Computer Configuration | Windows Settings | Scripts | Startup and then click the Add and in the Script Name click the Browse which opens the startup folder, I copy my vbscript or batch file as shown below:

Batch File:
NET USE Z: \\F-AD\DATA /PERSISTENT:YES

VbScript:
‘ —— SCRIPT CONFIGURATION ——
strDrive = “Z:”
strPath = “\\F-AD\DATA”
strUser = “” ‘ e.g. AMER\rallen
strPassword = “
boolPersistent = True ‘ True = Persistent ; False = Not Persistent
‘ —— END CONFIGURATION ———
set objNetwork = WScript.CreateObject(“WScript.Network”)
objNetwork.MapNetworkDrive strDrive, strPath, boolPersistent
WScript.Echo “Successfully mapped drive”

Then close all the windows, and then login from one of the Windows XP machine from that OU, and the drive letter doesn’t get mapped.

Any help is appreciated, as I have about 30computers in that ou, that needs to be mapped to that drive letter, any one who logs into it.

But after logging in If I run the batch file or the vbscript from that folder as shown below, it runs fine:
C:\WINDOWS\sysvol\sysvol\d214.org\Policies\{7BAA60E2-3C6D-4D88-A18B-2E15A6A457F0}\Machine\Scripts\Startup

This discussion is locked

All Comments