Skip to main content

Shutdown Your Computer or a Remote PC 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, 8 or 8.1) 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) in the Command Prompt 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.

Comments

Popular posts from this blog

How To Run C C++ Java Programs Without Any Software. [By TechFilz]

How To Run C C++ Java Programs Without Any Software C/C++ and Java are the also known as the mother of all the programming languages as this is one of the best Object Oriented Programming Language Of Computer World that plays great role in building out the real life project. So today in many school colleges of the world are teaching this language as a part of their studies. But you need a compiler and an interface to use these programming language. But not all the students have computer with them. That is why we are here to resolve the problem of  How To Run C C++ Java Programs Without Any Application . Yes you can do this without any need of any third party software in your PC. Just follow up the below method to proceed. How To Run C C++ Java Programs Without Any Software Run C C++ Java Programs Without Computer The method is simple and cool and with this you can run C/C++ and Java program in any smart device without having any software or compiler. Also this method ...

Cool Notepad tricks for Windows

Notepad, the text editor that comes bundled in Windows is an excellent tool for text editing. But that is not the only thing for which notepad is famous. It is also famous for its tricks and hacks. Here is a roundup of some of the best and coolest tricks that you can try using Notepad. Matrix Falling Code Effect - Notepad CMD (.BAT) Tricks Inspired by the movie Matrix, this falling code trick is extremely popular on social networking websites. Copy and paste the code given below in Notepad and save the file as "Matrix.bat" or *.bat.  @echo off color 02 :tricks echo %random%%random%%random%%random%%random%%random%%random%%random% goto tricks Matrix Falling Code Effect - Notepad Trick Upon running the bat file, you will see the "Matrix falling code" effect. Make Your Keyboard Type (Any) Message Continuously-VBS Trick This VBS trick can make any of your friend's keyboard type any message continuously. Open Notepad, copy the code given below and s...

10 Apps You Probably Didn’t Know Can Earn You Extra Money

You probably already know that there are apps you can use not only for entertainment, but for earning extra money or saving some. But, you may not know about these apps, which are some of our favorites. Check out these 10 killer apps you can use to save or make extra money in your spare time. 1.  Foap Download links:  Android  |  iOS This is an app that allows you to make money by taking photos. You can charge as much as you like per photo, which means that your money-making opportunities through Foap are virtually limitless. People are always looking for a huge variety of photos, and you may be surprised at how much money you can make with a photo of your cat. 2.  Bookscouter Download links:  Web-Based If you have old books you want to get rid of, use this app to sell them. Scan the barcodes with your smartphone, and Bookscouter will let you see comparisons of payouts from more than 20 book buyback companies. Once you find the be...