<http://www.netikka.net/tsneti/info/tscmd071.htm>
Copyright © 2003-2010 by Prof. Timo Salmi  
Last modified Tue 11-May-2010 18:52:00

 
Assorted NT/2000/XP/.. CMD.EXE Script Tricks
From the html version of the tscmd.zip 1cmdfaq.txt file
To the Description and the Index
 

This page is edited from the 1cmdfaq.txt faq-file contained in my tscmd.zip command line interface (CLI) collection. That zipped file has much additional material, including a number of detached .cmd script files. It is recommended that you also get the zipped version as a companion.

Please see "The Description and the Index page" for the conditions of usage and other such information.



71} How can I reboot my computer from a command line script?

Warmboot in the old MS-DOS terminology. In XP this is really simple.
  @echo off
  shutdown -r

Or, a bit more fully
  @echo off & setlocal enableextensions
  set /p ask_=Restart, are you sure [y/N]?
  if /i not "%ask_%"=="y" if /i not "%ask_%"=="yes" goto :EOF
  @shutdown -r -f -c "Shutting down and restarting from a command line script"
  endlocal & goto :EOF

On a multi-user system you may wish to check if anyone else is logged on before rebooting.

References/Comments:
  hh ntcmds.chm::/shutdown.htm