When I started looking at this question, I didn't realize there were so many ways to shut down a machine! For Windows XP and Windows Server 2003, a new command line program, SHUTDOWN.EXE, takes all the work out of it. Using the command "SHUTDOWN -s -t 1" will turn off the computer immediately. The "-s" command line options specifies shutdown, and the "-t 1" says to delay one second (in other words, immediately). The SHUTDOWN program also powers off the machines if they have relatively recent BIOS.
In researching this question, I was all set to write some VBScript code to do the shutdown on Windows 2000 when I ran across Rob van der Woude's outstanding scripting resource page. On Rob's Web site there are all sorts of great Windows Script Hosting (WSH) examples as well as batch files galore.
This was first published in February 2003