Every Windows 11 Recovery Mode Command Prompt Command You Need
WinRE (the Windows Recovery Environment) is a built-in repair tool that opens outside your normal desktop, so you can fix a PC that won’t start. The Recovery Mode Command Prompt lets you run text-based commands to scan your drive, repair startup files, and rescue your data when Windows 11 fails to load.
Knowing these commands can save you a panicked reinstall or a paid repair when a quick fix brings the system back. Work through them in the order shown. They go from the least risky repair to the most.
Open the Recovery Mode Command Prompt from Windows 11’s Advanced startup options, then run SFC and DISM first to repair damaged system files. Use sfc /scannow /offbootdir=📁C:\
What Is the Windows Recovery Environment and How Do You Open It?
The Windows Recovery Environment is a troubleshooting screen that runs separately from your normal operating system. There are three common ways to reach it, depending on how badly the PC is broken.
- From inside Windows 11 (if your PC turns on):
- Open Settings System Recovery.
- Next to Advanced startup, click Restart now.
- Confirm the restart if Windows asks. The PC reboots into the blue recovery options screen.
- Using the power button trick (if your PC will not boot):
- Turn on the computer.
- As soon as you see the logo or the loading dots, press and hold the physical power button for about 10 seconds to force a hard shutdown.
- Turn the computer back on and repeat this two to three times.
- On the next startup, Windows notices the failures and loads the Automatic Repair screen. From there, open the advanced options.
- Using installation media (if the PC is completely broken):
- Boot the PC from a Windows 11 USB installation drive. You may need to pick the USB drive from the boot menu or change the boot order in the BIOS/UEFI.
- Click Next on the first setup screen.
- Click Repair your computer in the bottom-left corner.
Once you reach the blue recovery screen, follow these steps:
- Click Troubleshoot.
- Click Advanced options.
- Click Command Prompt.
- If Windows asks you to pick an account and enter its password, do so. If the drive is encrypted with BitLocker, you may also be asked for the recovery key. You can usually find that key in your Microsoft account.
A black window with white text opens. This is your command line workspace. To leave it later, close the window and choose Continue to try booting Windows again.
Essential 🪟 Windows 11 Recovery Mode Command Prompt Commands
In recovery mode, your main Windows drive often gets a different letter than usual. It is commonly D: instead of the usual C:. The letters are assigned fresh each time recovery loads, so don’t assume. Check the letter before you run any repair command, because pointing a command at the wrong drive either fails or repairs the wrong thing.
The Notepad trick shown later in this guide is a quick way to see which drive letter holds your Windows folder.

1Run SFC to Repair Windows System Files
Run SFC (System File Checker) to scan your system files for damage, missing pieces, or modifications. If the tool finds a broken file, it replaces it with a healthy copy from your computer’s hidden component storage, which can get your PC booting properly again.
- Type the following command and press Enter:Code
sfc /scannow /offbootdir=C:\ /offwindir=C:\windows - Wait for the scan to finish. It can sit at a low percentage for a while, so don’t close the window.
- Read the result. It tells you whether it found no problems, repaired files, or found damage it could not fix.
If SFC reports damage it cannot repair, move on to DISM in the next section.
2Run DISM to Repair Windows System Images
Run DISM (Deployment Image Servicing and Management, a tool that repairs core system files) to fix the base system image when SFC cannot. This command replaces corrupted image files using clean recovery sources.
- Type the following command and press Enter:Code
DISM /Image:C:\ /Cleanup-Image /RestoreHealth - Wait for the operation to reach 100% and report its result.
This command checks the health of your Windows image on drive C: and repairs any damage it finds. As with SFC, change the drive letter if your Windows drive has a different one in recovery mode. If DISM and SFC both complete cleanly, run SFC once more, since it now has a healthy source to repair from.
3Run CHKDSK to Repair File System and Bad Sectors
The Check Disk utility, or CHKDSK, scans your hard drive or solid-state drive for bad sectors and file system errors, and recovers readable data when crashes stem from storage corruption. It helps resolve disk read errors that stop your computer from starting up.
- Type the following command and press Enter:Code
chkdsk C: /f /r - If it asks whether to schedule the check, answer as the prompt directs. In recovery the drive is usually not in use, so it normally starts right away.
- Let it finish. Do not turn off the PC while it runs.
The /f option tells the tool to fix any errors it finds. The /r option looks for bad sectors and saves readable information. This can take a few minutes or a few hours, depending on the size and speed of your drive. On a laptop, plug in the charger first. If CHKDSK keeps finding new bad sectors on a traditional hard drive, the drive may be failing, so back up your files soon.
4Run BOOTREC to Fix Boot Startup Failures
The bootrec commands fix startup failures when your computer turns on and shows a screen saying it cannot find a boot device. They rebuild your master boot record, boot sector, and boot configuration data.
- Type the first command in the list below and press Enter.
- Wait for it to report success, then type the next command and press Enter.
- Repeat for each line, one at a time.
bootrec /fixmbr
bootrec /fixboot
bootrec /scanos
bootrec /rebuildbcdThese commands repair the Master Boot Record, write a new boot sector to your system drive, scan your drives for installed operating systems, and rebuild the boot database from scratch.
On a PC that boots in UEFI mode, one of these commands may return an “Access is denied” error. That is a known behavior on many UEFI systems and does not mean the whole process failed. Note which command gave the error, and try restarting to see if Windows now loads. If the scan step lists a Windows installation, the tool may ask whether to add it to the boot list. Answer as the prompt directs.
5Manage Disks and Partitions Using DISKPART
DISKPART lets you look at your drive partitions, clean a drive, or assign drive letters while fixing your PC. It gives you raw partition and drive controls directly inside the recovery environment. Use it carefully, because some of its actions are destructive.
- Type the following command and press Enter:Code
diskpart - Wait until the prompt changes to show you are inside Diskpart.
- Type the following commands, one at a time, pressing Enter after each:Code
list disk select disk 0 list volume exit
These commands show all connected storage drives, select your primary hard disk, list all available volumes and their drive letters, and exit the disk tool. Nothing in this list changes your data. The listing is also a handy way to find which letter your Windows volume has been given.
Be careful with other Diskpart actions, such as cleaning a drive. A clean wipes the partition information from the selected disk, and you cannot undo it. Always confirm the disk number before you act on it.
Advanced Troubleshooting: Diagnosing Hardware and Recovering Files
Besides repairing system files and boot records, the recovery Command Prompt lets you run hardware tests and rescue your personal files before you try a factory reset or clean install.
Diagnosing Memory Problems with MDSCHED
The Windows Memory Diagnostic tool, or MDSCHED, checks your RAM. Bad memory is a common cause of random crashes, unexpected restarts, and blue screen errors.
- Type the following command and press Enter:Code
mdsched.exe - When a window asks what to do, choose the option to restart now and check for problems, or the one to check the next time you start your computer.
- Let the PC restart and run the test. It shows its progress on a blue screen and then boots on its own when done.
The test can take several minutes. If the tool does not open from the recovery prompt, run it from a working Windows session instead by searching for Windows Memory Diagnostic in Start. If it reports errors, a faulty RAM module is likely, and no software repair will fix that.
Rescuing Personal Files Using XCOPY and Notepad
If your computer cannot be fixed, you can back up your important documents, photos, and files to an external USB drive from the recovery Command Prompt. Do this before you reinstall Windows. The method uses Notepad to find the right drive letter and then the copy command to move the files.
- Plug in an external USB drive.
- Type
notepadand press Enter. A simple Notepad window opens. - In Notepad, click File Open.
- Change the file type view to All Files.
- Click This PC in the left pane and look at the drives listed. Note the drive letter of your USB flash drive, such as E: or F:, and the letter that holds your Windows and Users folders.
- Close Notepad.
- Type a copy command for your user folder. For example, type:Code
xcopy C:\Users\USERNAME\Documents E:\BackupDocuments /E /I /H
Make sure the USB drive has enough free space for what you are copying. When the command finishes, open the USB drive in Notepad’s file dialog again to confirm the files arrived before you wipe anything.
Alternative Recovery Methods When Commands Fail
If the command prompt tools fail, you still have options. If your system does not work after running the repair commands, return to the Troubleshoot menu to reinstall core files or factory reset your device.
Reset this PC: Go back to the Troubleshoot menu in the Windows Recovery Environment and select Reset this PC. You can choose to keep your personal files while Windows wipes and reinstalls the core system files. Your installed apps and settings are removed either way, so back up first if you can.
Clean Installation: If your recovery partition is completely broken, use another working computer to download the official Windows 11 installation media creation tool. Put it on a blank USB flash drive, boot the broken PC from that drive, and perform a clean installation of Windows 11. The USB drive gets erased when you create the media, so use one with nothing important on it.

Summary
If this didn’t work
If startup repairs fail entirely, try the Reset this PC feature or perform a clean installation from a USB drive. Rescue your files first if you haven’t already.
Frequently asked questions
What does the command prompt look like in Windows recovery tool?
The Recovery Mode Command Prompt is a plain black window with white text and a blinking cursor. Each line ends in a prompt such as 📁X:\
What is the command prompt to search and fix 🪟 Windows 11?
Run sfc /scannow /offbootdir=📁C:\
How to boot from a recovery win 11 drive and access the command prompt?
Plug the recovery USB drive into the PC and turn it on. Press the boot menu key your PC uses, often F12, F11, F9, or Esc, and choose the USB drive. Pick your keyboard layout, then select Troubleshoot, Advanced options, and Command Prompt. If the boot menu does not appear, open your BIOS or UEFI settings and move the USB drive to the top of the boot order.
What is the command for help on Windows recovery mode?
Type help and press Enter to see a list of the available commands. For details on a single command, type its name followed by /?. For example, sfc /? shows the options for the System File Checker. Checking the syntax this way helps you avoid typos before you run a repair.
How do you switch over to c drive in recovery command prompt?
Type C: and press Enter to switch to the C drive. Then type dir to list its files and folders. If you do not see Windows folders, the Windows drive may use a different letter in recovery mode. Try D:, E:, and so on, checking each one with dir, until you find the folder that holds your files.
How to boot 🪟 Windows 11 in recovery mode from command prompt?
Save all open work first, because the next command restarts the PC right away. Open Command Prompt in Windows 11 as administrator, type shutdown /r /o /f /t 00, and press Enter. The /f option closes open apps without saving them. The Choose an option screen then opens, where you can select Troubleshoot, Advanced options, and Command Prompt.
Still have a question?
Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.
Did this guide fix your problem?
About the Author
Richard
Tech Writer, IT Professional
Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.
No comments yet — be the first to share your thoughts!