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

While installing Windows 10 or Windows 11, you can open a Command Prompt without leaving Setup. 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. This guide shows how to open it, what you can do there, and how to open it from the recovery environment if Setup is not running.

Quick Answer

At almost any screen in Windows Setup (including the language screen and the out-of-box setup screens), press Shift + F10. On many laptops, press Shift + Fn + F10. A Command Prompt window opens with administrator rights.

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.

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.

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.

Troubleshooting

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.

Frequently Asked Questions

Does the Command Prompt in Setup have administrator rights?

Yes. It runs with full system privileges in the Setup environment.

Can I use PowerShell?

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

How do I close it?

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

Summary

  1. Press Shift + F10 (or Shift + Fn + F10) during Setup.
  2. Or use Repair your computer > Troubleshoot > Command Prompt.
  3. Use tools like diskpart, notepad, and robocopy carefully.
  4. Type exit to return to Setup.