Restarting the Command Prompt (CMD) in Windows 11 resolves temporary glitches, fixes corrupted command history, or clears frozen prompts—without needing a full system reboot. Simply close and reopen the window or force a restart via Task Manager or Command Prompt itself. This guide covers every method, including when to use each, common mistakes, and troubleshooting if CMD refuses to restart.
What You'll Need
- Windows 11 PC
- Windows Command Prompt application (comes pre-installed)
Step-by-Step
- Method 1: Basic Close and Reopen
- Open CMD by pressing Win + X and selecting "Terminal" (Windows Terminal) or "Command Prompt."
- If CMD is unresponsive, click the X button in the top-right corner and wait for it to close automatically (Windows handles this gently).
- Reopen CMD as in Step 1. The prompt should refresh.
- Method 2: Force Restart via Task Manager
- Press Ctrl + Shift + Esc to open Task Manager.
- Go to the "Details" tab.
- Find the line beginning with "cmd.exe" (the Command Prompt process).
- Right-click the process and select "End task."
- Close Task Manager and reopen CMD (same as Method 1, Step 1).
- Method 3: Restart CMD from Inside Itself
- Open CMD as in Method 1.
- Type the following command in the prompt and press Enter:
taskkill /f /im cmd.exe - Wait a moment for all CMD processes to terminate.
- Close the terminal window and reopen it normally.
Common Mistakes
- Closing without waiting: If CMD freezes, clicking the X button too quickly may not close it properly. Let it shut down fully before reopening.
- Running "taskkill" incorrectly: Using the wrong command (e.g.,
taskkill /f cmd.exeinstead oftaskkill /f /im cmd.exe) can force-close other processes unintentionally. - Ignoring warnings: If CMD crashes repeatedly, there may be a deeper issue—try the next troubleshooting steps instead.
Tips
- Use Windows Terminal instead: Windows 11’s built-in Windows Terminal (found in Settings > Apps > Default apps) supports tabs and better tab management—open it with Win + X and select "Windows Terminal."
- Check for corrupted files: If CMD still won’t restart, try creating a new admin CMD prompt to rule out system-level corruption:
- Press Win + X > "Terminal (Admin)."
- If this opens normally, CMD works; the issue is likely with your existing session.
- Update Windows: An outdated system can cause CMD instability. Run:
Settings > Windows Update > Check for updatesbefore retrying.
Troubleshooting
If CMD refuses to restart after all methods above, try these advanced steps:
- Check for system errors
- Press Win + X > "Task Manager."
- Go to the "Performance" tab and check for errors in the "Memory" or "CPU" graphs.
- If you see high usage or crashes, a deeper system issue may exist.
- Reset CMD’s configuration
- Open CMD normally and type:
reg delete "HKCU\Software\Microsoft\Command Processor" /f - Type
restartto restart CMD. - This clears the command history and settings—use if CMD is overly persistent in saving corrupted data.
- Open CMD normally and type:
- Restore default CMD settings
- Open Command Prompt as admin.
- Type:
reg restore "HKCU\Software\Microsoft\Command Processor\Cmd.exe" - Restart CMD normally. This overwrites custom CMD settings.
- Reinstall CMD (last resort)
- Back up important scripts or commands.
- Use PowerShell or Command Prompt to delete CMD’s files:
rmdir /s /q C:\Windows\System32\cmd\ - Restart your PC. Windows will reinstall CMD during startup.
- Note: This replaces all custom CMD configurations.
Frequently Asked Questions
Why won’t CMD open after I force-restarted it?
Try opening CMD as administrator first (Win + X > Terminal (Admin)), as some permissions issues can prevent normal sessions.
Will force-restarting CMD delete my open commands?
Yes, the process is abrupt—your open commands will be erased. To save them, copy-paste the entire prompt to a file before closing.
What if CMD keeps freezing after restart?
The issue may stem from a corrupted system file. Check for updates or run:
sfc /scannow
from an elevated CMD session to scan for system errors.
Can I make CMD run in the background?
Windows Terminal supports background tabs, but true background CMD isn’t natively supported—use Windows Terminal with tabs instead.
Why does restarting CMD not help if my PC’s stuck?
If your PC is unresponsive, CMD restart alone won’t fix hardware or driver issues. Use Ctrl + Alt + Del to force a shutdown or restart the PC directly.
How do I reset CMD’s history without deleting all commands?
Type setx /m COMAND_PROCESSOR_HISTORY_SIZE 0 in an elevated CMD session to clear history without resetting the app entirely.