Startup script on computers doesn not work via group policy

By ikram.hussain ·
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:

strDrive = "Z:"
strPath = "\\F-AD\DATA"
strUser = "<User>" ' e.g. AMER\rallen
strPassword = "<Password>"
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:

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Wrong place in the GPO

by neilb@uk In reply to Startup script on compute ...

The script is trying to run on the computer when it starts up. If you want the users to pick up the drive when they log on, you'll need to put it in User Configuration | Windows Settings | Scripts | Logon in a GPO that the users pick up.

Collapse -

Yep I Think Your Script is in the Wrong Place.

by cfrond In reply to Startup script on compute ...

As the previous post mentioned your script is set on the Machine instead of the User. The path for the script should look like:


See if this doesn't help you some,

Assign Logon Script via Group Policy

Collapse -

Yes It Works

by ikram.hussain In reply to Yep I Think Your Script i ...

Yes, after setting it to user it works.

Thanks a lot to all of you.

Related Discussions

Related Forums