Learn how to shutdown, log off or restart your PC using cmd.exe command lines.
In the previous lesson on windows shortcuts, there were various shortcut keys that you need to know in order to use your PC easier and control it like a pro.
Now, in this lesson 2, we will be learning how to shut down and restart your PC using cmd.exe command lines. With these, you don’t need to always use your mouse to navigate in your PC.
How to shutdown a PC using cmd.exe:
Step1: On your desktop, navigate to the start menu and click. Then use the search button and search for cmd. You can just type ‘cmd’. However, if you have gone through the first lesson, you don’t need to go through this process. You can use the shortcut key for that. Hold the windows key and the letter R (windows key + R), a little window will appear usually at the left hand corner of your desktop like the one in the image below.
Step2: When the cmd windows opens, you should type the command below:
Shutdown –s –t
After typing it, you now have to type the particular time you want your PC to shut down. You can test it with 60 seconds. Now your full command will be like this:
Shutdown –s –t 60
Then press the enter key.
You can see how I did mine in the image below:
NOTE: This command will not work if you don’t press the enter key. So pressing the enter key is very important.
How to shutdown a PC with cmd.exe and show a message.
Having known how to shutdown your PC using cmd.exe. it will also be nice if you learn how to shutdown your PC and also display a message. This message can be used as a notification on why the system is about to shut down. In order to add this feature, you need to retype the command like you did in the first section.
Shutdown –s –t 60
Then you need to add the notification or message you want to be seen. Your command will now look like this:
Shutdown –s –t 60 –c “you have used me a lot and I need to rest”
Then you press the enter key. Note that you must put the quotation marks so that the command will work and always press the enter key.
How to stop the PC from shutting down after running these commands.
You can as well counter the command. If you don’t want your system to shut down anymore, probably because you are still busy with something, you can as well stop the command from working. This requires another line of command.
To do this, you need to type the command below:
then press the enter key. This will stop your PC from shutting down.
How to restart a PC using cmd.exe.
Again, this requires a different command. In your cmd.exe, type:
This will make your PC to restart.
How to log off a PC using cmd.exe
Logging off a PC has its own separate code altogether. In the cmd.exe, type:
Your PC will log off.
From this lesson, there are things you need to take note of:
Always press the enter key so that a command will run.
Ensure that you put the quotation marks where and when necessary.
Try and use the shortcuts and was taught in lesson 1. They will really help a lot.
That’s the end of the lesson 2. More lessons will be uploaded soonest. Stay in touch with technobs!
Hi, I am frank, an inspired tech. blogger, web developer and a computer hardware technician. Catch up with tutorials, tech news, programming tips and lots more!