GPO Scripts Startup/Shutdown

  • Thread starter Thread starter 2006Dave2007
  • Start date Start date
2

2006Dave2007

We have created a script that basically cleans/defrags the PC and placed it
in the shutdown scripts in our OU GPO.

However, this scripts runs on restarts and shutdowns. Is there any way to
have this script run only when a user specifies shutdown? Sometimes during
the day, people for various reasons restart their pc...this script takes a
long time, thus causing frustration...

Thanks
 
Howdie!
We have created a script that basically cleans/defrags the PC and placed it
in the shutdown scripts in our OU GPO.

However, this scripts runs on restarts and shutdowns. Is there any way to
have this script run only when a user specifies shutdown? Sometimes during
the day, people for various reasons restart their pc...this script takes a
long time, thus causing frustration...

You would have to query Windows' state and the kind of shutdown it
undertakes in the script. That's the kind of approach you need to take.
You won't be able to tweak that in GP really. Not sure if you can do
that with Batch either.

An alternative would be looking at the time during script execution. If
it's after 3pm, execute the defrag things - if it's prior to 3pm, the
user most likely wants to just reboot.

cheers,

Florian
 
Back
Top