How to shutdown Windows XP via script

Basically there are two ways of shutting down Windows via Scripts: With admin-rights or without.

The tools that work with admin rights are:

  • shutdown.exe which comes with Windows XP Pro etc.
  • psshutdown.exe which comes with pstools (sysinternals.com)
  • the WMI method

Tools that work without admin rights: AutoIt-Script with single call “shutdown(13)”.

Granting access to non admin users to shutdown

In the  administrative tools – local security settings – local policies – user rights assignment:  Click “Force shutdown from a remote system” at the right. Click “Add User or Group”.  Enter the name INTERACTIVE and click “Check names”. This gives the right only to an interactive user. Its not possible to shutdown the computer over the network with that setting.