When are Windows Server 2003/2008 shutdown scripts run in the shutdown process?
We have a service running on our remote file servers. This process prefers to be cleanly stopped prior to a shutdown event. “Prefers” means it gives us fewer issues after it starts back up again. I want to use a local shutdown policy to run the “stop” command to this process. This stop process stops the app cleanly and then stops the service. This part is easy. What I want to understand is where in the shutdown process is this script run? I’ve found this great blog, but it does not mention it. http://blogs.msdn.com/ntdebugging/archive/2007/06/09/how-windows-shuts-down.aspx Basically if the service is shutdown before the script runs then there is no point in running the job. I can’t easily test this as they are all production boxes.
April 27th, 2010 7:34am

Hi, Have you tried using group policy shutdown scripts eg: gpedit.msc --> computer confi --> windows settings --> scripts --> shutdown , add the required batch file / script file and during shutdown , the batch file would be invoked and your service would be stopped
Free Windows Admin Tool Kit Click here and download it now
April 27th, 2010 8:09am

Hi, Thanks for the response. Yes this is what I'm wanting to do and is very easy. The unclear part is when does this run? Is it before the shutdown process is kicked off or somewhere in the middle and therefore possibly redundant for me? I know I can script something up to test it - write the logs out to a file and see what happens, but they are production servers and my ability to play with them is somewhat limited as a result.
April 27th, 2010 10:35pm

shutdown scripts run before the computer deletes network connections
Free Windows Admin Tool Kit Click here and download it now
April 29th, 2010 11:45am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics