Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to run script before the computer running Windows 7 or 2008 shuts down without using local group policy editor or domain based policy? Regedit tool should be OK if possible.

share|improve this question
Do you mean the local group policy editor or domain based policy? – joeqwerty Jan 28 '12 at 16:35
Yes sorry for the weak description. – Mat Banik Jan 28 '12 at 16:38
All that regedit would do is directly manipulate the registery keys that the local security policy or group policy consoles would. I recommend using those tools instead. – MDMarra Jan 28 '12 at 17:22
up vote 3 down vote accepted

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Shutdown

this is the location I think you are looking for.

share|improve this answer
When I go to "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\" I do not see any "Scripts" key under Windows 7. – Mat Banik Jan 28 '12 at 17:53
do this use the local policies tool to create the proper key then just copy the results. – tony roth Jan 28 '12 at 18:15
I can seem to be able to fined Local Policy Tool. Only thing I have is Local Security Policy Tool. – Mat Banik Jan 28 '12 at 18:19
MMC... File... Add/Remove Snap-in... Group Policy Object Editor... Add... Local Computer... Finish... OK – joeqwerty Jan 28 '12 at 19:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.