- Using the shutdown command gives you full control over shutting down and restarting.
- CMD allows you to schedule automated tasks such as shutting down after a certain time
- You can send warning messages before the shutdown or do it remotely.
On many occasions we need to shut down, restart or suspend our computer quickly, without depending on the graphical menus of Windows. Whether due to a system failure, wanting to automate tasks or simply because We prefer to do everything with commands’s most emblematic landmarks, the symbol of the system (CMD) is a fundamental tool to achieve this.
If you've ever been unable to access the start button or want to schedule your computer to shut down at a specific time, CMD commands are a simple, practical, and very effective solution. In this guide, we'll show you step-by-step how to shut down, restart, or suspend your computer from the console, as well as show you how to do it. Tricks and advanced uses that can get you out of more than one tight spot.
What exactly is CMD or Command Prompt?
CMD is the common name for Symbol of the system in Windows, a tool that works as command interpreterThat is, it allows you to enter direct commands that the operating system executes without going through the graphical interface.
This command line environment comes from the old MS-DOS and remains current because It remains very useful for administration, diagnostics, configuration and automation tasks. both on personal computers and servers.
From CMD you can execute actions such as shutting down or restarting the computer, closing sessions, changing settings of the system, access hidden folders, forma tear units and much more. The interesting thing is that many of these actions can also be automate or customize through scripts, timers, or shortcuts.
Advantages of using commands to shut down or restart Windows
Using CMD may seem intimidating at first, but it has multiple benefits over the traditional method of clicking on the Start menu. Here are some of the most notable advantages:
- Time saving: Running a command takes only a few seconds and avoids unnecessary clicks.
- Automation: Ideal for creating scripts that shut down or restart your computer at certain times or after certain tasks.
- Accessibility: Allows you to shut down or restart in cases where the start button is unresponsive or Windows is frozen.
- Flexibility: Commands allow you to fine-tune the behavior of the shutdown or restart.
Also, you can use them remote form, something very useful if you manage multiple networked computers or work on a server infrastructure.
How to Access Command Prompt (CMD) in Windows
Before starting any command, you need to open the CMD console. There are several ways to do this in Windows 10 and Windows 11Here are the most common ones:
With a keyboard shortcut
- Press the keys Windows + R to open the Run window.
- Write
cmdand press Enter or click OK.
Another useful combination is Windows + X and then select “Command Prompt (Admin)” or “Windows Terminal” depending on the system version.
From the search menu
- Click the magnifying glass or the search bar next to the start menu.
- Write cmd o symbol of the system.
- Click the corresponding result. If you need more privileges, select Run as administrator.
From file explorer
- Open Explorer (Windows + E).
- Navigate to route C: \ Windows \ System32.
- Locate the file cmd.exe and double-click on it or right-click and choose Run as administrator.
Shutdown Command: The Key to Turning Off, Restarting, and More
The most direct way to shut down or restart your computer from CMD is by using the command shutdown, which supports a wide variety of parameters to modify its behavior. Its basic syntax is
shutdown
Here you have the most used parameters:
- /s: Turn off the equipment.
- /r: Restart your computer.
- /l: Closes the active session.
- /a: Cancels a shutdown or restart in progress.
- /t : Schedule shutdown or restart after a specified number of seconds.
- /f: Force close applications without displaying warnings.
- /p: : Shuts down the system immediately without any waiting time.
- /h: Hibernates the computer.
- /e: Document the reason for the shutdown if it occurs unexpectedly.
There are also other less common but useful options, such as /m for remote shutdown, /o to open the advanced startup menu, or /d to indicate specific reasons for the shutdown.
Shut down your computer with CMD
To perform a simple shutdown, you just need to type the following command and press Enter:
shutdown / s
This will start a countdown (30 seconds by default) before shutting down the system. If you want the shutdown to happen immediately, you can use:
shutdown / s / t 0
Would you prefer it to turn off in a few minutes? Use the parameter /t followed by the time in seconds:
shutdown / s / t 300 (5 minutos)
To cancel a shutdown in progress, type:
shutdown / a
Reboot the system with commands
The steps to restart your PC are very similar to shutting down. Use this instruction:
shutdown / r
You can also configure a wait before the system reboots with:
shutdown / r / t 120 (2 minutos)
And if you regret it or need to cancel the action:
shutdown / a
You can also restart another networked computer with parameter /m:
shutdown /r /m \\nombre_del_equipo
Remember that you'll need administrator permissions, and the remote computer must have the appropriate permissions enabled.
Suspend or hibernate your computer with commands
In addition to shutting down or restarting, you can also suspend or hibernate the system, something very useful if you want to leave the equipment ready to work again later.
To hibernate directly:
shutdown/h
If you want to suspend instead of hibernate, you can use this alternative command:
rundll32.exe powrprof.dll, SetSuspendState 0,1,0
But for it to work properly, make sure you first disable hibernation with:
powercfg -h off
After using the suspend command, you can reactivate hibernation if you wish:
powercfg -h on
How to schedule shutdown, restart, or hibernation
One of the most useful functions of the shutdown command is that it allows you to schedule tasks to have your computer automatically shut down, restart, or hibernate after a few seconds. If you want to dig deeper into task automation in Windows, this article on task scheduling it can be very helpful.
This is especially useful if you tend to leave tasks in progress, or if you prefer your computer to shut down at a certain time without having to do it manually.
- Schedule shutdown: shutdown / s / t 1800 to turn off in 30 minutes.
- Schedule reboot: shutdown / r / t 600 to restart in 10 minutes.
- Schedule hibernation: You can use a Task Scheduler task to run shutdown/h.
Also, you can cancel at any time the action scheduled with:
shutdown / a
Sending warning messages before shutdown
If you share the computer with other people, you can add personalized messages to notify of the shutdown or restart so that other users can save their work.
For example:
shutdown /s /t 300 /c «The computer will shut down soon. Save your work.»
This will display a pop-up window with that text. If There is older, it may appear as a notification at the bottom of the screen.
Create shortcuts to run commands with one click
If you want to make the process even easier, you can create desktop shortcuts to automatically execute shutdown, restart, hibernate, or sleep commands.
- Right-click on the desktop and choose “New > Shortcut.”
- In the location, type the command you want to use (for example:
shutdown /s /t 600). - Give it a name: “Turn off in 10 minutes.”
- If you want, change the icon from Properties > Change Icon.
This way, you can run commands without opening CMD every time.
Shut down computers remotely from CMD
Another very useful advanced feature is the ability to shut down or restart other networked computers using the same shutdown command with the parameter /mFor more details on remote management, we recommend you consult our article on Windows remote control.
For example:
shutdown /s /m \\equipo-red /t 60 /f /c "Apagado remoto por mantenimiento"
For this to work, the remote computer must be configured correctly:
1. Enable the remote registry service
- Press Windows + R, type
services.mscand hit Enter. - Find the “Remote Registry” service and open it.
- Set the Startup Type to Automatic.
2. Configure Windows Firewall
- Open the Firewall from the control panel.
- Select “Allow an app through Firewall.”
- Enable “Windows Management Instrumentation (WMI)”.
You'll also need administrator rights on the remote computer. If you do this correctly, you'll be able to easily control other computers on your network.
Once you learn how to use shutdown and combine key commands with parameters like /t, /f or /c, you have in your hands one powerful tool to manage any team quickly, solvency and efficiencyFrom household chores to server administration needs to troubleshooting errors, CMD is an underrated ally that deserves a prominent place in the repertoire of any user who wants to get the most out of their PC.
Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.