Run a Command Line Program at Shutdown

  • Thread starter Thread starter Apples
  • Start date Start date
A

Apples

Hi,
I want to run a backup program when the pc is shutdown.
I can run the program from command line.
Can I set up Windows XP so that when a user selects shutdown the
command line is run then the pc shuts down.
I am hoping there is a line in the registry I can put the command line
in to run the backup program.
I don't want to install extra programs if I can help it.

Allan
 
thanks for that any chance of a pointer on how to wright a script to
run a command lin or bat file.

this is all new to me

Allan
 
Sort of depends on what you want to do. If it is just one simple command, create a batch file and put the command line there. Easy way: create a new text file called shutdown.txt. Edit that to add the command you want to run. Save it, then rename the file to be shutdown.cmd. Now point to that file in the shutdown policy. You can also run a VBScript (.vbs), about anything you can run manually will work.

Here are a few examples (it's the same as Windows 2000):

Windows 2000 Script Policies:
http://www.winntmag.com/Articles/Index.cfm?ArticleID=7223

Assigning Scripts Using Group Policy in Windows 2000:
http://www.serverwatch.com/tutorials/article.php/1474241


--

Bill James
Microsoft MVP·DTS

Win9x VBScript Utilities » www.billsway.com/vbspage/
Windows Tweaks & Tips » www.billsway.com/notes_public/
 
Thanks again.
I found I had to set it up on log off as in shutdown the pc had closed
the network connection.
works great thanks again.

Allan
 
Back
Top