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
- Open Command Prompt as Administrator:
- Press
Win + Xon your keyboard, then select Terminal (Admin) or Command Prompt (Admin) from the menu. - 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.
- Press
- Run the shutdown command:
- Type the following command exactly as written, then press
Enter:shutdown /r /t 0 - The
/rflag restarts the PC, and/t 0forces an immediate restart (no delay).
Alternative (if you prefer a restart confirmation): Type
shutdown /r /fand pressEnterto restart with a forced shutdown (stops running processes). - Type the following command exactly as written, then press
- Wait for the restart:
- The PC will now shut down and reboot automatically. If the command fails (e.g., no internet), the PC may hang—see Troubleshooting below.
- 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 5adds 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 0in 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 w32timeandnet start w32timeto 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 + Deland selecting Shut Down.
Troubleshooting
If the restart does not work:
- 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.
- Check for system locks: Run
tasklistto see if any processes are stuck (e.g., explorer.exe hangs). Kill them withtaskkill /f /im explorer.exe, then retry the restart. - Disable antivirus temporarily: Some security software blocks shutdown commands. Temporarily disable it to test.
- Use the Windows PowerShell method: Open PowerShell as admin and run:
Restart-Computer -ForceThis has the same effect asshutdown /r /f. - Last resort: Safe Mode: Boot into Safe Mode (press
F8at 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.