Unlocking Hibernate: Command Line Mastery
Ever wished your computer could take a quick nap without closing all your work? Enter hibernate mode—a power-saving state that keeps your session intact while saving energy. In this guide, we unravel the secrets of how to hibernate Windows 10 command line and how to hibernate Windows 11 command line. Prepare to be enlightened (and perhaps a tad amused by the quirky quirks of our tech world).
While the usual GUI options are always available, the command line offers speed, precision, and a bit of that retro-tech charm. Here’s why you might prefer it:
- 🔹 Efficiency: Quickly toggle hibernation without navigating menus.
- 🔹 Automation: Integrate hibernation into scripts for streamlined workflows.
- 🔹 Control: Customize settings for a truly personalized experience.
Step-by-Step Guide
1. Enabling Hibernate Mode
Before you can command your system to hibernate, ensure the feature is activated. Open Command Prompt with administrator privileges and run:
This command ensures your computer is ready for hibernation. If it was already enabled, you’re good to go. If not, consider this a gentle reminder to update your system settings—because who doesn’t love a system ready for action?
2. Commanding Hibernate
Once hibernation is enabled, simply execute the following command to send your system into a deep sleep:
That’s it! Your system will hibernate, preserving your open applications and unsaved documents. It’s almost like magic, only with fewer rabbits and more binary.
Windows 10 vs. Windows 11: A Quick Comparison
While both Windows 10 and Windows 11 share similar command line procedures for hibernation, subtle differences might matter for the discerning user. Here’s a table that breaks down the key points:
Feature | Windows 10 | Windows 11 | Notes |
---|---|---|---|
Hibernate Activation | ✅ Yes | ✅ Yes | Same command: powercfg /hibernate on |
Hibernation Command | ✅ Yes | ✅ Yes | Same command: shutdown /h |
User Interface Enhancements | ❌ Minimal | ✅ Modernized | Windows 11 may offer improved visual feedback |
Script Integration | ✅ Excellent | ✅ Excellent | Both support automation without compromise |
The table above shows that while the core functionality remains unchanged, Windows 11 brings a touch of modernity to the experience, making it more intuitive for new users.
Pro Tips for Command Line Hibernate
- 🔹 Automate Your Workflow: Create a batch file with the commands and schedule it with Task Scheduler for automatic hibernation at specific times.
- 🔹 Combine with Other Scripts: Integrate hibernate commands into larger scripts for backup routines or maintenance tasks.
- 🔹 Troubleshooting: If hibernate doesn’t work as expected, verify that your system supports hibernation and that it isn’t disabled by power settings or group policies.
Final Thoughts
Embracing the command line for hibernation might seem like a throwback to the days of DOS, but it’s a powerful tool for modern productivity. Whether you’re on Windows 10 or Windows 11, knowing how to hibernate via command line not only saves energy but also adds a touch of elegance to your tech routine. So next time you need a quick power nap for your PC, remember: a simple command can do the trick!
(Image credit: Future)
Although, on Windows 10, you can conveniently sign out, shut down, restart, or hibernate your computer from the Start menu or Lock screen, the system also includes the shutdown.exe tool that allows you to perform the same power operations through Command Prompt.
It is also a more powerful tool since, in addition to the common tasks, the command-line tool supports more advanced options, including the ability to record the reason for the event, display custom messages to the end-user, and even use the tool to shut down and restart remote devices.
You can use this tool at any time. However, it will usually come in handy if you spend most of your time in the Command Prompt terminal, you need to create a script that involves restarting the computer, or you are making system changes, and you want to record a reason for the restart or shutdown event.
This guide will walk you through how to use the shutdown.exe command-line tool to shut down and restart local and remote computers.
How to turn off computer with shutdown command
To shut down the computer manually with Command Prompt, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to gracefully shut down the device after one minute and press Enter: shutdown /s
- Type the following command to shut down the device after a specific time and press Enter: shutdown /s /t TIME
In the command, replace TIME for the second to wait before the device begins the shutdown process. For example, this command turns off the computer after five seconds: shutdown /s /t 5
- Quick tip: You can also use «0» for the time to turn off the device immediately. If the time is greater than zero, then the /f option will be applied automatically.
- Type the following command to shut down the computer without waiting or warning and press Enter: shutdown /p
- Type the following command to shut down, forcing all apps to close without warning, and press Enter: shutdown /s /f
Once you complete the steps, the computer will execute the shutdown process depending on your specified options.
All the latest news, reviews, and guides for Windows and Xbox diehards.
Shut down specifying reason
To turn off the device recording for a specific reason on Windows 10, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to include a reason for the shutdown and press Enter: shutdown /s /d p:MAJOR-NUMBER:MINOR-NUMBER
In the command, change the MAJOR-NUMBER:MINOR-NUMBER for the numbers that represent the reason. You can determine all the available major and minor reason numbers by running the shutdown /? command. For example, this command shuts down the device, recording the «Operating System: Service pack (Planned)» reason: shutdown /s /t 1 /d p:2:16. You can also switch the /s for the /r option if you want to specify a reason for the restart in the command. Here’s how: shutdown /r /t 1 /d p:2:16
- Type the following command to power off the computer specifying a reason as unplanned and press Enter: shutdown /s /t 1 /d u:2:16
The above command will shut down the device, recording the «Operating System: Service pack (Unplanned)» reason.
After you complete the steps, the Windows 10 device will shut down and log the specified reason.
You can always view the shutdown logs in Event Viewer > Windows Logs > System and look for the «Information» event with the User32 source and with the «Event ID» of 1074.
Shut down with custom dialog message
To shut down a computer showing a dialog message alerting the user of the action, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to shutdown the device showing a custom dialog message and press Enter: shutdown /s /t TIME /c «MESSAGE»
In the command, replace TIME with the number of seconds before shutting down the computer, and replace MESSAGE with the custom text you want to display to the user. For example, this command displays the «Updating XYZ company app» before shutting down the computer after one minute: shutdown /s /t 60 /c «Updating XYZ company app.» You can also switch the /s for the /r option if you want to show a message for the restart in the command. Here’s how: shutdown /r /t 60 /c «Updating XYZ company app.»
Once you complete the steps, Windows 10 will display the «Updating XYZ company app» message to the user and power off the computer after 60 seconds.
How to turn off remote computer with shutdown command
The shutdown command-line tool also allows you to remotely turn off or restart a device. However, the tool is limited, and you will perform extra steps to get it working.
Configure remote device
To set up the remote computer to allow remote command executions, use these steps:
Warning: This is a friendly reminder that editing the Registry is risky and can cause irreversible damage to your installation if you don’t do it correctly. It’s recommended to make a full backup of your computer before proceeding.
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to disable the User Account Control for remote executions and press Enter: reg add HKLM\Software\Microsoft\windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
After you complete the steps, the device will be open to receive commands remotely from authenticated users.
If you want to revert the changes to improve the device security, you can use the same instructions outlined above, but in step 3, make sure to run this command: reg add HKLM\Software\Microsoft\windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 0 /f.
Shut down remote device
To use the Command Prompt to shut down a computer remotely, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to connect to the IPC$ share (or null session connection) and press Enter: net use \\REMOTE-PC\ipc$
In the command, replace REMOTE-PC with the name or IP address of the remote computer. For example, this command connects to the computer: net use \\10.1.4.120\ipc$
- Confirm the account name located in the remote device and press Enter.
- Confirm the account password and press Enter.
- Type the following command to restart the remote computer and press Enter: shutdown /r /m \\REMOTE-PC /t TIME /c «COMMENT» /f
In the command, replace REMOTE-PC for the name or IP address of the remote computer, TIME for the number of seconds to wait before beginning the shutdown process, and replace COMMENT for the custom dialog you want to send the user. For example, this command will notify the user and force the device to close all applications without warnings after one minute: shutdown /r /m \\10.1.4.120 /t 60 /c «This PC will restart in one minute for maintenance.» /f. If no one is using the computer, you can immediately send a command that restarts the device. Here’s an example: shutdown /r /m \\10.1.4.120 /t 0 /f
Once you complete the steps, the remote host will power off according to the command configuration.
If you want to disconnect from the IPC$ share, run the following command: «net use * /delete» (without quotations) and press Y to confirm. If you plan to use this command, you may need to remap previously connected network drives.
How to restart computer with shutdown command
To restart a Windows 10 device with Command Prompt, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to restart the device and press Enter: shutdown /r
- Type the following command to restart the device after a specific time and press Enter: shutdown /r /t TIME
In the command, replace TIME for the second to wait before the device begins the restart process. For example, this command restarts the computer after five seconds: shutdown /r /t 5
- Quick tip: You can also use «0» for the time to restart the device immediately.
- Type the following command to restart without waiting, or warning and press Enter: shutdown /r /p
- Type the following command to shut down, forcing all apps to close without warning, and press Enter: shutdown /r /f
After you complete the steps, the computer will restart according to the options you specified in the command.
How to sign out session with shutdown command
The shutdown tool also includes an option to sign out a user, but it is only available for the local computer, and you can only sign out of the current session. You cannot log off other users or someone on a remote device.
To log off of a Windows 10 account with Command Prompt, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to sign out of the current account session and press Enter: shutdown /L
Once you complete the steps, the current user session will be signed out.
How to hibernate computer with shutdown command
To put the computer into a hibernate state with a command, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to hibernate the device and press Enter: shutdown /h
After you complete the steps, the device will enter into the hibernation state. However, this only works on devices that support the feature. You can use these steps to enable and configure hibernation on Windows 10.
How to boot in firmware mode with shutdown command
The command-line tool even includes an option to start the computer into the Unified Extensible Firmware Interface (UEFI) or Basic Input Output System (BIOS) firmware without the need for extra steps.
To start the device in the UEFI or BIOS interface, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to restart the device into the firmware and press Enter: shutdown /r /fw
- Type the following command to shut down the computer and boot into the firmware during the next startup and press Enter: shutdown /s /fw
Alternatively, you can also use the /p instead of the /s option to close all running applications and force the shutdown without warning.
Once you complete the steps, the computer will boot into the firmware interface.
How to access the Advanced boot options with shutdown command
The «Advanced boot options» experience is the environment that includes various tools to troubleshoot and fix problems on Windows 10. Although you can use the Settings app or the USB flash drive to access these tools, you can also get into this experience with one shutdown command.
To start the computer in the Advanced boot options, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to restart the device into the Advanced boot options experience and press Enter: shutdown /r /o
- Type the following command to shut down the computer and start the Advanced boot options experience during the next startup and press Enter: shutdown /s /o
Alternatively, you can also use the /p instead of the /s option to close all running applications and force the shutdown without warning.
After you complete the steps, the computer will start in the Advanced boot tools, allowing you to access recovery tools to troubleshoot and fix the installation.
How to abort computer power off operation with shutdown command
This option is only available when using the time-out option on a remote computer. If the computer is scheduled to shut down after a specific period, you can abort the process.
To abort a shutdown, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to abort the shutdown and press Enter: shutdown /a /m \\REMOTE-PC
In the command, replace REMOTE-PC with the name or IP address of the remote computer. For example, this command aborts the shutdown action on the remote computer: shutdown /a /m \\10.1.4.120
In these steps, it is assumed you successfully ran the shutdown command, meaning you did the steps to configure the local computer and remote devices to allow the remote command execution (see above instructions).
We are focusing this guide on Windows 10, but the command-line tool has been available for a long time, which means you can refer to these instructions if you are still using Windows 8.x. Shutdown.exe is also available for Windows 7, but the options are limited. For example, the /o and /hybrid options are available starting on Windows 8.
More resources
For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:
- Windows 10 on Windows Central – All you need to know
- Windows 10 forums on Windows Central
Cutting-edge operating system
A refreshed design in Windows 11 enables you to do what you want effortlessly and safely, with biometric logins for encrypted authentication and advanced antivirus defenses.
Mauro Huculak has been a Windows How-To Expert contributor for WindowsCentral.com for nearly a decade and has over 15 years of experience writing comprehensive guides. He also has an IT background and has achieved different professional certifications from Microsoft, Cisco, VMware, and CompTIA. He has been recognized as a Microsoft MVP for many years.
on December 30, 2011
We can hibernate a Windows computer from command prompt using shutdown command. Shutdown command has various switches for different operations like shutdown, reboot, hibernate, log off etc. The command for hibernating windows computer is given below.
shutdown /h
This works on all Windows versions – XP, Vista, Windows 7, Server 2003 and Server 2008.
Shutdown can be used in a batch script file also. Once the command is triggered, we can’t abort the hibernation operation.
Related Posts:
Enable hibernation in Windows
Windows 10 comes with support for several advanced tools and one such tool is the powercfg. It is a handy command-line tool that allows users to manage many aspects of power plans or schemes on the computer.
Using this tool, the user can create, edit, and delete power plans on the computer, along with customizing or disabling several power-related features. In this step-by-step guide, we will show how to use the powercfg tool in the Command Prompt to Enable Hibernation in Windows 10.
Step 1: Open the Command Prompt in Administrator mode. For this, open the Start menu and search for the term Command Prompt. In the search results, right-click on the app and select “Run as Administrator.”
Step 2: In the Command Prompt, type in the following command to confirm is hibernation is supported on your system.
powercfg /availablesleepstates
If Hibernate shows up in the available states on your computer, then you will be able to enable the feature.
Step 3: To enable Hibernation on your Windows 10 computer, type the following command in the Command Prompt.
powercfg /hibernate on
That’s it. Once the above-mentioned steps have been followed, the hibernation mode on the Windows 10-powered computer will be enabled. You can follow the same steps and change the word “on” to “off” in Step 3 to disable this mode.
Microsoft has embedded numerous features for various types of users in its Window 10 OS, where many of them aren’t even known to a general user. Hibernation is one such feature that’s little used, and not so often by few people. While many go with sleep or shutting down their systems, hibernation has its own purpose too.
Hibernating is like a deep sleep and has thin differences between shutting down and putting your PC into sleep. When did, it stores all your current work into your drive (SSD or hard drive) instead of RAM and shuts down your PC. Thus, it fulfills both the purposes of shutting down and sleep.
A major advantage of putting your PC into hibernation is saving power. Your PC doesn’t draw any power while in hibernation since it’s shut down, yet saves your work on a hard drive for later use. Thus, it’s a useful feature worth trying. Here’s how;
Also Read- 100+ Windows 10 Run Commands You Should Know
1.) Open Command Prompt with admin privileges. For this, type “cmd” in Windows Search, spot the Command Prompt result, right-click on it to open the options. Now click on “Run as Administrator.”
2.) Once the Command Prompt is opened, type as below to check whether your system supports hibernation or not.
powercfg /availablesleepstates
3.) This shows all the available power configurations (and not) your PC supports. And if it shows Hibernation in the available options, you’re eligible to activate this function.
4.) Now, type in as below to active the hibernation function.
powercfg /hibernate on
This would then hibernate your PC, as said above. Waking up from this mode is simple, too; press any key on the keyboard or the CPU’s power button to wake it up. And to turn this function off, go through the same process, and type in “off” instead of “on” in step 2 of the command prompt.