Shutting down, rebooting or logging of can be accomplished in Windows by using ExitWindows or ExitWindowsEx.

These work fine in win9x - but in NT (i.e. Win2k + XP too) you need to faff around with privileges to shut down or reboot.

In windows NT etc, it's far too much effort, you should get a command line program like in the resource kit reboot.exe for you

Just RTFM for ExitWindows or ExitWindowsEx (I think)

Mark