How to automate local group policy for startup/shutdown scripts

S

Scott Felt

My scenario:

I need to run a program or a script that will implement the startup
and shutdown scripts functionality found in group policy (acutally, I
just need to have scripts that will run on system startup and shutdown
and I assume this is the best way to do that; correct me if there is
an easier way, please). There is no Active Directory, so this is
local group policy and it needs to be hands off--in other words,
bringing up gpedit.msc and pointing and clicking around is not
feasible.

Things I have tried:

I have experiemented with getting one system the way I want and then
copying over various files in the %windows%\system32\grouppolicy
directory tree to another system. I have not had much luck doing
this. By moving over or overwriting the scripts.ini file I was able
to "see" the script that I wanted to run, but they did not actually
run at startup or shutdown. (I did have the script in place). I have
tried moving a registry.pol file over, but I do not really know what
is in that file, whether it has my changes or how it is "loaded" on
the new system.

Any help is greatly appreciated. Thanks!

Scott Felt
 
J

Jerold Schulman

My scenario:

I need to run a program or a script that will implement the startup
and shutdown scripts functionality found in group policy (acutally, I
just need to have scripts that will run on system startup and shutdown
and I assume this is the best way to do that; correct me if there is
an easier way, please). There is no Active Directory, so this is
local group policy and it needs to be hands off--in other words,
bringing up gpedit.msc and pointing and clicking around is not
feasible.

Things I have tried:

I have experiemented with getting one system the way I want and then
copying over various files in the %windows%\system32\grouppolicy
directory tree to another system. I have not had much luck doing
this. By moving over or overwriting the scripts.ini file I was able
to "see" the script that I wanted to run, but they did not actually
run at startup or shutdown. (I did have the script in place). I have
tried moving a registry.pol file over, but I do not really know what
is in that file, whether it has my changes or how it is "loaded" on
the new system.

Any help is greatly appreciated. Thanks!

Scott Felt


See tip 3612 in the 'Tips & Tricks' at http://www.jsiinc.com

Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
D

Darren Mar-Elia

Scott-
You're on the right track. You definitely need to copy the script to
C:\WINDOWS\System32\GroupPolicy\Machine\Scripts\Startup (or refer to it
elsewhere) and then you need scripts.ini in the Scripts folder. But you also
need to ensure that the GPT.INI file in the c:\windows\system32\grouppolicy
folder has a version number that is greater than 0. Take a look at that file
and, if its zero, increment it by 1.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top