How to Open Command Prompt in Windows Setup (Shift + F10)

To open Command Prompt while installing Windows 10 or Windows 11, press Shift + F10 at almost any Setup screen, including the language screen and the out-of-box setup screens. On many laptops, press Shift + Fn + F10. A Command Prompt window opens with administrator rights. It is handy for preparing disks, checking drive letters, loading storage drivers, copying files off a failing system, or troubleshooting an installation that will not continue.

Windows Setup screen with a Command Prompt window opened by Shift plus F10, with the keys and prompt highlighted
Press Shift + F10 (1) during Setup to open a Command Prompt (2).

Method 1: Shift + F10 During Setup

  1. Boot from your Windows installation USB or DVD.
  2. At any Setup screen, such as the language selection or "Where do you want to install Windows?", press Shift + F10.
  3. If nothing happens, try Shift + Fn + F10, or click on the Setup window first so it has focus.

The same shortcut works during the first-time setup screens (OOBE) after Windows installs.

How do I close it?

Type exit or close the window. Setup continues where you left off.

Method 2: Repair Your Computer

  1. On the first Setup screen, click Next.
  2. Click Repair your computer in the lower-left corner.
  3. Choose Troubleshoot > Command Prompt (on some versions, Troubleshoot > Advanced options > Command Prompt).

Method 3: From an Installed Windows (Advanced Startup)

If Windows is installed but will not start properly, force the recovery environment by interrupting startup three times, or from Windows go to Settings > Recovery > Advanced startup > Restart now. Then choose Troubleshoot > Advanced options > Command Prompt.

Useful Commands in Setup

Command What it does
diskpart Opens the disk partitioning tool (list disk, select disk, clean, convert gpt)
notepad Opens Notepad; use File > Open as a simple file browser
dir C:\ Lists files, useful to find which letter is your Windows drive (it may not be C: in Setup)
drvload E:\driver\file.inf Loads a storage or network driver
robocopy or xcopy Copies files to a USB drive before reinstalling
chkdsk D: /f Checks and repairs a drive
bootrec / bcdboot Repairs boot configuration (recovery environment)

Be careful with diskpart: commands like clean erase the selected disk immediately. Run list disk and select disk carefully, and back up data first.

Can I use PowerShell?

Standard Windows installation media usually does not include PowerShell in Setup. Use Command Prompt.

Example: Prepare a Disk for Installation

  1. Type diskpart and press Enter.
  2. Type list disk to see all disks.
  3. Type select disk 0 (use the correct number).
  4. Type clean to erase it (only if you are sure).
  5. Type convert gpt for modern UEFI systems.
  6. Type exit, close Command Prompt, and click Refresh in Setup.

When the Setup Command Prompt Acts Up

Shift + F10 does nothing

Try Shift + Fn + F10, use an external USB keyboard, or click the Setup window first. Some managed or customized installation media may disable the shortcut.

My drive letters look different

In Setup, drive letters are often reassigned. Use dir or diskpart > list volume to find the right drive.