Wednesday, May 16, 2012

Shutdown Your Computer or a Remote Computer via Command Prompt

Shutdown Your Computer or a Remote Computer via Command Prompt

Most of us shutdown our computers using the power button given in the Start menu. Some of us use the physical power button on our machines. Very few people actually use other means of shutting down a computer and even less is the number of people who use the command prompt to shutdown a computer.



A reason for this is that most of us don't know that the command prompt can be used to not only shutdown, restart or log off our computer instantly but also to shutdown a remote computer provided you have administrative access. It can also be used to hibernate a computer and give a comment containing the reason for shutdown. This post will show you how to do all this.

Shutdown computer with command prompt
Required
A computer running Windows (XP, Vista, 7 or 8) with the command prompt working perfectly, i.e. not disabled by a virus.

Initial Steps
1) Press Windows Key + R.
2) Enter CMD and press Enter.

This will start the command prompt. Follow the instructions below depending on what you want to do.

Shutdown Local Machine (Your Computer)
Type "shutdown -s" without the quotes in the command prompt and press Enter. Shutdown is the command being executed and the switch -s tells the computer to shutdown.

Restart your Local Computer
Type "shutdown -r" in the command prompt and press Enter. In this case, the command switch -r is telling the computer to restart after shutdown.

Log Off the Current User
Type "shutdown -l" in the command prompt and press Enter. The -l command switch tells the computer to log off.

Shutdown a Remote Computer
Type "shutdown -s -m \\name of the computer" in the command prompt and press Enter. Replace \\name of the computer with the actual name of the remote computer you are trying to shutdown. As mentioned earlier, you must have administrative access to the computer you are trying to shutdown. To know if you have administrative access, press Windows key + R and then type the name of the computer and press Enter.

Note: If you don't remember the name of the remote computer, you can look for it by opening a list of all the computers you are connected to by executing "net view" in command prompt.

If you can connect to the computer, you will be asked to login with your username and password. Upon entering them, a window will display the list of all the directories available to you. This should help you know whether you can or cannot shutdown the remote computer.

Hibernate a Local Computer
Type in "Rundll32.exe Powrprof.dll,SetSuspendState" without the quotes and press Enter. Your computer should hibernate, if it does not, then you must enable hibernation to do this.

Shutdown your or a remote computer after a specific time
Type "shutdown -s -t 60" to shutdown your computer after 60 seconds. Upon executing this, a countdown timer displaying a warning message will be shown. This command uses the -t command switch followed by a variable (which is 60 in this case) which represents the number of seconds after which the computer will shutdown.

Display a Message containing the reason for shutdown
Type shutdown -s  -t 500 -c "I am tired. I don't want to work anymore." (with the quotes) and press Enter. The -c switch is used in the code to give the reason for shutting down and what is followed in quotes will be displayed in the dialog box as the reason. This can be used to display all sorts of funny messages. One example :-

Skynet has become self aware. John Connor did not stop me. You can not use your PC anymore.

Stop a System Shutdown
Type "shutdown -a" and press Enter. This will stop the system from shutting down if the countdown to shut down has not reached 0.

1 comments

Unknown September 26, 2012 at 6:40 PM

Wonderful blog & good post.Its really helpful for me, awaiting for more new post. Keep Blogging!

Online Computer Support

Post a Comment

All Labels

Android Android Tricks Apple Apple Tricks being Bentley beyond Black Blizzard Blogger Blogger Gadget Blogger Tricks Bluetooth brilliance Buffalo business Business camera Camera Canon Canons Carrier cellular Cellular Challenge Chicken Chrono Cisco Close Cloud collaboration com combined Comics coming Command Computer Tricks Concept Concepts Confirmed Connect Connector Continental Conundrum Coolpix Creed Dawnguard defeat details Diablo doesnt Double dramatic Droid durable E-Money EA4500 Edition energizing EOS1D Episode Essentials expansions Facebook Tricks Fantasy Featured features Ferrari figure Final first footage forget Fourth Freeform Freeman front Gadgets News Galaxy Game News gameplay games Gamesplanet GamesRadars GConnect Google Gordon Grand GreatCall Griffin GTechnology Guardians Guild Hacking Tricks HalfLife HDPATU3 HE400 Headphones HiFiMan Hitman holder horrifying Iconia IdeaPad Incredible ingame Innergie Inspiration Internet Tricks iPhone iSung itself Jelly Jitterbug Justice Kickstarter Killer killing launch launches leaked Lenovo Lexus lifted Limbo Limited Linksys loads Local MacBook Machines Make Money Marvel Mazda Micro Microsofts MiddleEarth might MiniStation Mission mobile Mobile Tricks Monster montage Mount MS Office News Nexus Nikon North October offers Online Optimus Other Other Tricks partially parts Payne phone phones physics planned player PlayStation PocketCell potential power Premium Professional Quantum Quarters Raider ready really Rechargeable recut register release released remixed Remote Resident resolution restrictions revealed review Robot roundup Router running sample Samsung Sauron season September sequel Series shows Shure silver Skyrims Smart smashing Sniper sniping Software Tricks Something Sonos Special sports SRH1440 stirs Studios stuff subway Summer Supertrailer Tablet Tacoma teased Technology Tegra Telltale Theres thickness things Thirds Thunderbolt today Toshiba Total Touring Toyota trailer trailers Tricks turning unlocked Unofficial Unveiled Valve Verizon video videos Virus Tricks Walking weeks Which Window Windows Windows 7 Windows 8 Windows Vista Windows XP winners Wireless zombie