TroubleChute Logo
TIPS

How to Restart your computer


Published: Apr 1, 2023
Last Edit: Feb 10, 2025
Windows Tips
1,497 Words, 7 Minutes.

Watch the video:


Timestamps:
0:00 - Intro
0:25 - Restart using Start menu
0:35 - Start+X method
0:45 - Hard reboot
0:55 - Reboot with CMD
1:12 - Reboot without CMD!
1:26 - Reboot with Powershell (2 methods!)
1:52 - Using your PC Reset button
2:06 - Restart with Cortana
2:21 - Ctrl+Alt+Delete
2:32 - Restart with WMIC
2:56 - Restart with Windows Update
3:20 - Lock screen
3:34 - Restart graphics driver
3:53 - Restart with AutoHotKey
4:37 - Add "Restart" option to Right-Click menu
5:30 - Create a restart shortcut
5:50 - Force BSOD (Bluescreen)
6:00 - Code a simple C++ app
7:13 - Host a web server with Python that has a reboot button

What this guide is

Looking to restart your Windows computer? This guide has everything you’ll ever need and far, far more.

Oh, and this doesn’t need to be said, but: SAVE YOUR WORK! Restarting your computer will close all active programs and sessions. It’s pretty obvious.

1. Restart using Start menu

This is the age-old method. Just hit Start, and in the bottom Right of the Start Menu (Windows 11), or bottom left (Windows 10) you can click the power button, then restart.

2. Start+X method

Hit Start+X (Both the Start and x buttons on your keyboard) to bring up a list of quick functions. Hover over Shut down or sign out and then select Restart to restart your computer.

3. Hard reboot

If your computer has a power button (It probably does, just lean over and look at it): Hold the power button in and the computer will turn off after a few seconds. Then just press it again to start the computer again.

4. Reboot with CMD

Open the Command Prompt with Start+R, then enter cmd. Click OK or hit enter.

When it’s open, run the command: shutdown /r. This will take a few seconds to restart your computer. For an instant method, run shutdown /r /t 0 to restart instantly.

5. Reboot without CMD!

Similar to the previous method, run shutdown /r, but instead of using the Command Prompt, just hit Start+R and type it directly in the Run window.

6. & 7. Reboot with Powershell (2 methods!)

Open Windows Powershell by either hitting Start+R and typing “pwoershell”, or by searching the Start Menu for “powershell”. Either way, when it’s open you can run the previous command shutdown /r, or to be more correct, run Restart-Computer.

8. Using your PC Reset button

If your computer has a power button, and it’s a desktop computer (tower), you likely have a “Reset” button. This can have a few icons, and is usually less obvious, but placed nearby to the power button to help you reset your computer instantly. Some cases will have this, others not.

9. Restart with Cortana

Open Cortana by saying “Hey Cortana”, and then ask it to “Restart my computer”.

10. Ctrl+Alt+Delete

When you hit Ctrl+Alt+Delete, your computer will show a blank screen with options in the center. Look to the bottom-right where a power icon is. Click that pwoer icon and you should see a few options. Choose Restart.

11. Restart with WMIC

If you like complicating your life, then using long commands is another option. Open Command Prompt with a method from above, and enter:

wmic os where Primary='TRUE' reboot

12. Restart with Windows Update

If you have Windows Update enabled, and updates pending install, you can open the Windows Update section of your Settings app. You should see a “Restart” button instead of a “Check for updates” button. This isn’t always an option as sometimes there aren’t updates.

13. Lock screen

Press Start+L, or click your profile picture in the Start Menu and choose Lock.

When the computer prompts you for your password or to “Sign in”, you’re on the lock screen. In the bottom right you should see a power button. Upon clicking it, you should see the option to Restart.

14. Restart graphics driver

Sometimes a full reboot isn’t required. If your graphics driver is acting funky, you can press a nifty key combination on yuor keyboard to restart JUST the graphics driver, without the need to restart your computer completely.

Hit: Start+Ctrl+Shift+B

15. Restart with AutoHotKey

Install AutoHotKey (Version 1).

Create a new AHK file by Right-Clicking a folder and creating a new text document. Then rename it to something.ahk, just make sure to remove .txt to change the file type. You may need to show file extensions in order for this to work, if you don’t see .txt.

Open it with any text editor, and enter:

Add filename and type the code: Shutdown, 2.

16. Add “Restart” option to Right-Click menu

We can add a “Restart” option to the Windows context menu. Right-Click your desktop and you will be able to choose “Restart Computer”. Great?!

Open the Registry Editor by searching your Start Menu for Registry, or hit Start+R and run regedit.

Then head to: HKEY_CLASSES_ROOT\Directory\Background\shell

Right-Click the shell folder we’re in and New > Key. Give it the name “Restart Computer”.

Right-Click that folder and once again select New > Key. Give it the name “command”.

Open that key (folder). Double-Click the (Default) option. Enter shutdown /r /t 0 in the Value data section of the new Edit String window. Click OK, and you can close Registry Editor.

Now, right-click your Desktop, and you can choose “Restart Computer”.

17. Create a restart shortcut

Right-Click your desktop and choose New, then Shortcut. Enter shutdown /r /t 0 in the location for the shortcut. Click next. Then just remember to rename it something like Restart, so you know what it does.

18. Force BSOD (Bluescreen)

Open either Command Prompt or PowerShell as admin, and run the command: wininit.

19. Code a simple C++ app

Download and install Visual Studio using the Visual Studio Installer. Download it here.

When you install it, open the new Visual Studio Installer.

Uncheck everything but Desktop development with C++. Then click Install and wait.

When it opens, create a new C++ Console app.

Open Restart.cpp and enter the following code:

Restart.cpp
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include <Windows.h>

int main() {
    // Get the privilege to shut down the system
    HANDLE hToken;
    TOKEN_PRIVILEGES tkp;

    if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) {
        std::cerr << "OpenProcessToken failed, error " << GetLastError() << std::endl;
        return 1;
    }

    LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &tkp.Privileges[0].Luid);

    tkp.PrivilegeCount = 1;
    tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;

    AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0);

    if (GetLastError() != ERROR_SUCCESS) {
        std::cerr << "AdjustTokenPrivileges failed, error " << GetLastError() << std::endl;
        return 1;
    }

    // Restart the system
    if (!ExitWindowsEx(EWX_REBOOT | EWX_FORCEIFHUNG, SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER)) {
        std::cerr << "ExitWindowsEx failed, error " << GetLastError() << std::endl;
        return 1;
    }

    return 0;
}

Then just click Local Windows Debugger to build and run it on your copmter.

You can find an exe version in the project folder in x64\Debug.

20. Host a web server with Python that has a reboot button

This is by far the simplest and best way to restart your computer.

Download Python and install it.

Create a new restart.py file by renaming a new text document.

Save the following text into it using a text editor:

file_type_python restart_server.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from flask import Flask, render_template, request
import ctypes
import sys
import os

app = Flask(__name__)

def adjust_privilege(privilege_name):
    os.system("shutdown -t 0 -r -f")

def restart_computer():
    # Enable the SE_SHUTDOWN_NAME privilege
    adjust_privilege("SeShutdownPrivilege")

    # Call ExitWindowsEx to restart the computer
    if not ctypes.windll.user32.ExitWindowsEx(
        0x00000002 | 0x00000010,  # EWX_REBOOT | EWX_FORCEIFHUNG
        0x80000000 | 0x00040000,  # SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER
    ):
        print("ExitWindowsEx failed, error", ctypes.windll.kernel32.GetLastError())
        sys.exit(1)

@app.route("/")
def index():
    return render_template("index.html")

@app.route("/restart", methods=["POST"])
def handle_restart():
    restart_computer()
    return "Restarting...", 200

if __name__ == "__main__":
    app.run()

Then create a new text document and call it index.html. Enter the following code:

file_type_html index.html
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Restart Computer</title>
    <script>
        async function restartComputer() {
            const response = await fetch('/restart', { method: 'POST' });
            if (response.ok) {
                alert('The computer will restart now.');
            } else {
                alert('Failed to restart the computer.');
            }
        }
    </script>
</head>
<body>
    <h1>Restart Computer</h1>
    <button onclick="restartComputer()">Restart</button>
</body>
</html>

Now, we need to install Flask.

Open a new Command Prompt, and run pip install Flask.

Create a new folder called templates and place it next to the restart_server.py file. Then move the html file we created into it.

Now we can finally run restart_server.py. You may need to run it as admin.

You should see a locally hosted web address to reach the shutdown control website, likely http://localhost:5000 or http://127.0.0.1:5000

TroubleChute © Wesley Pyburn (TroubleChute)
Support Me Privacy Policy Cookies Policy Terms of Service Change privacy settings Contact