GPO Scripts Startup/Shutdown

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
 
F

Florian Frommherz [MVP]

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
 

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