/
/

How to Open Command Prompt at Boot in Windows 11

How to Open Command Prompt at Boot in Windows 11 blog banner image

Command Prompt is a useful text-based interface that lets users interact with the operating system by typing commands and returning output. This interface becomes even more important during boot because it allows for system-level troubleshooting and recovery when the OS fails to load or requires offline diagnostics.

Whether you’re an IT professional in an enterprise setting or an advanced user maintaining a computer system, it is crucial to know how to open Command Prompt at boot in Windows 11 to address critical issues like startup failures, file corruption, and account recovery. This guide will discuss several reliable methods, including GUI methods through recovery options, keyboard shortcuts, and command-line workarounds.

How to run a Command Prompt at boot in Windows 11

Windows 11 offers multiple ways to access Command Prompt during the boot process, each suited to different scenarios and offering flexibility to help users choose the most effective path based on their specific situation. (To ensure a smooth process, consider the suggested steps before proceeding.)

Method 1: Use Advanced Startup in Windows Settings

If you have a bootable and responsive system, accessing the Advanced startup section in Windows Settings is the most reliable method to open Command Prompt at boot in Windows 11.

Note: This method requires the OS to be bootable. Administrator credentials are necessary to launch the recovery Command Prompt. If BitLocker is enabled, the recovery key may be required to access drives.

  1. Open Settings > System > Recovery.
  2. Find Advanced Startup and click the Restart now button beside it.
  3. After reboot, navigate to Troubleshoot > Advanced options > Command Prompt.
  4. Select a user account and enter the correct password if prompted (PINs and biometric login don’t work here).
  5. Command Prompt will open in WinRE, allowing you to execute commands for troubleshooting or repairing the system.

Method 2: Use Shift + Restart from the power menu

This faster and more direct method lets you reach WinRE without opening Settings. It is best used if you need quick access to recovery tools and are already at the desktop or login screen.

Note: For this method to work, you must be able to access a functional Windows environment or login screen. Administrator credentials are required. BitLocker may prompt for the recovery key.

  1. On the desktop, hold the Shift key on your keyboard while clicking Start > Power > Restart. If you’re on the login screen, hold Shift while clicking Power > Restart. You can let go of the Shift key when the “Please wait” screen appears.
  2. The system will boot into Advanced Startup Options.
  3. Go to Troubleshoot > Advanced options > Command Prompt.
  4. Choose a user account and enter credentials if prompted.

Method 3: Boot from Windows 11 installation media

This method is viable if you have access to Windows installation media and your system is completely unbootable or corrupted. This is best used when you need a clean recovery shell for system image deployment or advanced diagnostics.

Note: You need to have a bootable USB/DVD drive with Windows 11 setup files. Administrator rights are not required to access Command Prompt but could be needed to modify protected files. With BitLocker-protected drives, Windows will prompt for the recovery key. Using unsigned tools or scripts will likely require disabling Secure Boot.

  1. Connect a bootable Windows 11 USB or DVD drive to your device.
  2. Restart your PC and boot from your Windows 11 USB drive. If your device won’t show the boot menu and it goes straight to the regular Windows startup, you may have to change the boot order.
  3. At the Windows Setup screen, press Shift + F10.

Note: Do not click Next, as you are not installing Windows.

  1. A Command Prompt window will open immediately.

Method 4: Launch via recovery partition at boot

This method is best used when your system fails to start and no external media is available. This will offer you access to recovery tools when installations or updates constantly interrupt normal booting and cause the failure to start.

Note: The recovery partition must be present and functional. If encryption is enabled, a BitLocker recovery key is needed. Admin credentials are required to access the Command Prompt.

  1. Turn on your PC or restart it if it’s already on.
  2. When the Windows or manufacturer logo appears, immediately hold the power button down to interrupt the normal boot process and turn it off completely.
  3. Repeat steps 1 and 2 about two to three times to make Windows assume that there’s a problem and force it to enter Automatic Repair mode.
  4. On the Automatic Repair screen, click the Advanced Options button.
  5. Click Troubleshoot > Advanced options > Command Prompt.
  6. A Command Prompt window will appear.

Steps to consider doing before proceeding

To ensure you can follow the instructions above without any issues or interruptions, consider doing the following before you start:

  • Suspend BitLocker: If BitLocker is enabled on the system drive, access from outside the normal OS, such as through Windows Recovery Environment (WinRE) or boot media, will require the BitLocker recovery key. Consider suspending BitLocker with PowerShell to avoid interruptions.
  • Disable Secure Boot: You must disable Secure Boot in some environments, as it may prevent non-Microsoft recovery tools or scripts via bootable media from running. Disabling Secure Boot in the BIOS/UEFI is sometimes necessary for advanced or enterprise-level diagnostics.

Why launch Command Prompt at boot

Launching Command Prompt at boot offers direct access to a Windows system before the full OS environment loads. This capability is vital in resolving various problems you simply cannot address through the standard desktop interface, particularly when the OS is unbootable, compromised, or misconfigured. Accessing Command Prompt at boot will allow you to:

  • Perform offline repairs: Admins can use tools like System File Checker (SFC) and Deployment Imaging Service and Management (DISM) in Command Prompt at boot to repair corrupted system files and restore missing components.
  • Troubleshoot startup failures: Windows may fail to boot because of bootloader issues, driver problems, or corrupted registries. In this Command Prompt, users can run various utilities to scan and repair boot configurations, disk errors, and integrity issues.
  • Modify files or the registry before the OS loads: Sometimes, users may need to replace or rename problematic drivers, edit offline registry hives, and delete malware files or faulty scripts that load during startup. To change these configurations and registry settings that are locked when the system is running, you need to access Command Prompt at boot.
  • Reset passwords and user accounts: Using Command Prompt at boot is beneficial in locked-out scenarios. It allows users to enable the hidden Administrator account and reset forgotten local user passwords.
  • Access and manage offline drives: When Windows becomes unbootable, the Command Prompt at boot still allows access to system drives, which makes it possible to back up files before reinstalling or repairing the OS, copy logs or dumps for diagnostics, and access encrypted drives with the BitLocker recovery key.
  • Deploy or restore system images: In enterprise environments where rapid deployment is necessary, IT administrators can use Command Prompt tools to apply a new Windows image to a drive and restore a system from a previously captured image.

Important considerations when using an elevated Command Prompt at boot

Some technical behaviors and limitations can affect your workflow when using Command Prompt at boot, especially in recovery environments. Make sure to consider the following to avoid confusion and errors:

  • Driver letters may differ: When in recovery mode, the familiar drive letters may change (e.g., C: might show up as D:) as Windows assigns these letters dynamically in a recovery environment.
  • Networking is disabled: When you’re in WinRE or using a bootable installation media, network features like Wi-Fi and Ethernet are not enabled automatically. You can’t connect to the internet or network shares unless you initialize networking manually. If you need to enable networking, type wpeinit in Command Prompt and press Enter.
  • Use cases: Command Prompt at boot lets users repair the system by running bcdedit (to fix boot issues), diskpart (to clean or partition drives), sfc /scannow /offbootdir= (to repair system files in offline mode), or dism /image (to service system images). It also allows for password recovery (for local accounts only) using the net user commands.

Command Prompt at boot: Taking control before Windows loads

Accessing Command Prompt at boot in Windows 11 enables powerful recovery, troubleshooting, administrative, and diagnostic capabilities, especially when the OS is unresponsive or inaccessible. It lets users reset passwords, repair boot files, recover data, and service a system image for better control over system maintenance and repair. Whether through Settings, boot media, or WinRE, these methods are essential tools for IT support and enterprise system management. By understanding the prerequisites, limitations, and ideal use cases for each approach, you can choose the most effective way to access the tools you need to minimize downtime and ensure system reliability.

You might also like

Ready to simplify the hardest parts of IT?
×

See NinjaOne in action!

By submitting this form, I accept NinjaOne's privacy policy.

NinjaOne Terms & Conditions

By clicking the “I Accept” button below, you indicate your acceptance of the following legal terms as well as our Terms of Use:

  • Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms.
  • Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party.
  • Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library belonging to or under the control of any other software provider.
  • Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations.
  • Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks.
  • Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script.
  • EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).