To restart your PC via Command Prompt, use a single command that forces a shutdown followed by an immediate reboot. This works on Windows and is useful when you can’t access the GUI due to errors or system freezes. No extra tools or admin rights are required beyond opening CMD as administrator.

What You'll Need

  • A Windows PC (Windows 10/11) with Command Prompt accessible.
  • Administrator privileges (for forceful shutdown/restart).
  • A fast internet connection or offline mode (if the PC is stuck).

Step-by-Step

  1. Open Command Prompt as Administrator:
    1. Press Win + X on your keyboard, then select Terminal (Admin) or Command Prompt (Admin) from the menu.
    2. If prompted by UAC (User Account Control), click Yes to approve admin access.

    Note: On Windows 11, the menu may appear as Windows Terminal (Admin). Labels can vary slightly by version or region.

  2. Run the shutdown command:
    1. Type the following command exactly as written, then press Enter: shutdown /r /t 0
    2. The /r flag restarts the PC, and /t 0 forces an immediate restart (no delay).

    Alternative (if you prefer a restart confirmation): Type shutdown /r /f and press Enter to restart with a forced shutdown (stops running processes).

  3. Wait for the restart:
    1. The PC will now shut down and reboot automatically. If the command fails (e.g., no internet), the PC may hang—see Troubleshooting below.
    2. On some systems, a black screen with the restart prompt may appear for 30 seconds before the screen turns off.

Common Mistakes

  • Not running CMD as Administrator: If the PC freezes or ignores commands, try opening CMD as admin again. Some shutdown commands require elevated privileges.
  • Typing the command incorrectly: Double-check for typos (e.g., shutdown /r /t 5 adds a 5-second delay). Extra spaces or symbols break the command.
  • Running the PC without internet: If the PC relies on cloud services or auto-updates, a restart via CMD may fail. For offline PCs, use shutdown /r /f (immediate shutdown without delay).
  • Using the wrong version of Windows: This method works on Windows 7–11. On older systems (pre-Windows 7), use shutdown /r /t 0 in an elevated CMD prompt.

Tips

  • Automate frequent restarts: Combine the command with a script (e.g., PowerShell) to run it at set times via Task Scheduler.
  • Check for pending updates: If the PC won’t restart normally, run net stop w32time and net start w32time to disable time synchronization (a common cause of hangs).
  • Useful alternatives:
    • shutdown /s /f – Immediate shutdown (no reboot), useful for troubleshooting.
    • shutdown /a – Cancel an existing restart/shutdown.
  • For stuck PCs: If the PC remains unresponsive after CMD restarts, force a shutdown manually by holding Alt + Ctrl + Del and selecting Shut Down.

Troubleshooting

If the restart does not work:

  1. Verify admin rights: Open CMD again as admin and try the command again. If it still fails, the PC may be in a locked state due to driver issues or malware.
  2. Check for system locks: Run tasklist to see if any processes are stuck (e.g., explorer.exe hangs). Kill them with taskkill /f /im explorer.exe, then retry the restart.
  3. Disable antivirus temporarily: Some security software blocks shutdown commands. Temporarily disable it to test.
  4. Use the Windows PowerShell method: Open PowerShell as admin and run: Restart-Computer -Force This has the same effect as shutdown /r /f.
  5. Last resort: Safe Mode: Boot into Safe Mode (press F8 at startup or search msconfig in CMD) and restart normally.

Frequently Asked Questions

How do I restart my PC via Command Prompt if it won’t open?

If the PC is frozen, use Alt + Ctrl + Del to open Task Manager, forcefully end stuck processes, then reboot by selecting Shut Down. If that fails, boot into Safe Mode (hold F8 at startup) and restart normally.

Can I schedule a restart using CMD commands?

Yes, combine the restart command with Task Scheduler in PowerShell: New-ScheduledJob -Name "RestartPC" -Action {Restart-Computer -Force} -Trigger Once -At "08:00"> (adjust time as needed).

Why does my PC restart but not fully shut down?

The /r flag forces a restart, not a shutdown. If drivers or services fail to stop cleanly, the PC may appear to restart but remain stuck. Force a shutdown with shutdown /s /f if needed.

Is there a way to restart my PC without admin rights?

No, Windows requires admin privileges to force a restart via CMD. If you lack admin access, contact your IT admin or use a password manager to recover admin rights.

What if my PC is infected with malware?

Malware may intercept shutdown commands. Boot from a live USB (e.g., Ubuntu), run antivirus scans, and restart normally. Avoid using the infected PC for sensitive tasks.

How do I cancel a pending restart from CMD?

Type shutdown /a in CMD to cancel any scheduled restart or shutdown. This works only if the command hasn’t been executed yet.