In XP there is a DOS command called shutdown. If you type shutdown /? from a command prompt you ...
stackoverflow.com