?
Solved

Execute a batch script before windows 2000 reboot or shutdown

Posted on 2004-09-23
3
Medium Priority
?
437 Views
Last Modified: 2010-04-14
Hello,

I have three services which needs to be stopped in a sequence before rebooting or shutting down the Windows 2000 server. I can use a batch script with net stop command to stop the services in an order. But I am not sure how I can execute this batch file before the OS  reboot or shut down.

Note that i can put a batch script in the windows startup folder to start the services in a sequence (setting the service start type to manual), but there is no provision in Windows 2000 to execute the batch script prior to shut down.

Thanks
0
Comment
Question by:yasmagic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Expert Comment

by:onesquin
ID: 12134304
This can be done through the local machine policy or through a domain policy if you want it to happen on several servers(or just that one).

GOTO-  Start | Run...  then type gpedit.msc, click OK.

Expand Computer Config | Windows Settings | Scripts  Double Click Shutdown and add your batch file.

On XP and maybe 2003 server you can type from the command line gpupdate and it should update the policy so when you shutdown it will run your script.

hope this helps
0
 

Author Comment

by:yasmagic
ID: 12138799
Thanks for the info. I have added a shutdown batch script to stop the services in a sequence and added that in gpedit.msc (Expand Computer Config | Windows Settings | Scripts  Double Click Shutdown and add your batch file). The problem is that when I reboot the server, I don't see the batch script getting executed. Is this only applicable when we shutdown the server?
0
 
LVL 3

Accepted Solution

by:
onesquin earned 2000 total points
ID: 12142214
I think it is ran in the background or when it shows the little box that says saving your settings.

2k and xp never show scripts running like nt4

Try adding a line that outputs to a file  echo It worked!! >> c:\test.txt to see if it ran... maybe add a timestamp too.  date /t >> c:\test.txt

good luck.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question