>Yes; it's done by calling the API function ExitWindowsEx(), and examples are available in both the FAQ and the Windows API sections.
I'm not sure if the FAQs cover the process security token needed to reboot NT/2000. If not,
Q251310 in the Microsoft KB covers this.
Mike Stewart