Automatically add shutdown scripts

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hello
I need a particular script to be executed at reboot/shutdown time. I
believe this script needs to be added in the scripts.ini file in
%systemroot%\system32\grouppolicy\machine\scripts directory under
the Shutdown header. However this needs to be done programatically and
cannot be done via gpedit.msc.
Currently, I have compiled an executable that does the above. The
executable edits/creates the scripts.ini file in the same way as it
would be done via gpedit.msc.
But the problem I have is that it the script is not being executed in
all cases at shutdown time. For instance, in one machine I had to view
the script entry via gpedit.msc before the shutdown scripts started
working.
This made me believe that gpedit.msc needs to be executed atleast once
on a given machine

I did notice that whenever I viewed it via gpedit.msc , the
"Version" variable in gpt.ini at %systemroot%\system32\grouppolicy
is incremented. So I tried setting that variable to "0" (trying to
mimic the case where gpedit.msc has not yet been called on this
machine), but the script still got executed.

I would like to know the steps that I need to take to ensure that the
shutdown scripts are executed (whether or not gpedit.msc has been
opened on that machine ). Is there anything else done other than
editing the script.ini file when one uses gpedit.msc ? I did notice
that the timestamp on the scripts.ini changes when one only views the
entries in it via gpedit.msc, but the scripts.ini file did?t change.

Any help is greatly appreciated

Thanks
Adeep

--
Posted using the http://www.windowsforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.windowsforumz.com/Group-Policy-Automatically-add-shutdown-scripts-ftopict551294.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.windowsforumz.com/eform.php?p=1746609
.



Relevant Pages

  • Automatically add shutdown scripts
    ... so I am posting again. ... I need a particular script to be executed at reboot/shutdown time. ... the script entry via gpedit.msc before the shutdown scripts started ...
    (microsoft.public.win2000.group_policy)
  • Releasing IP on Shutdown
    ... parter... ... I've read about 50 threads regarding shutdown scripts ... What I want to do is run "ipconfig /release" every time a user shuts ... putting "ipconfig /release" into the Script Parameters box? ...
    (microsoft.public.win2000.general)
  • Shutdown Scripts
    ... I had the problem with the "System Configuration Utility" message coming ... up on reboot every time I use it to make changes. ... but I sometimes forget to click on the script. ... So I used gpedit.msc to put this in the SHUTDOWN scripts. ...
    (microsoft.public.windowsxp.customize)