How to shut down your PC from the command line or run dialog box.
Read this post on boddhayan.wordpress.com