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.

Method 1: Shift + F10 During Setup
- Boot from your Windows installation USB or DVD.
- At any Setup screen, such as the language selection or "Where do you want to install Windows?", press Shift + F10.
- 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
- On the first Setup screen, click Next.
- Click Repair your computer in the lower-left corner.
- 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
- Type
diskpartand press Enter. - Type
list diskto see all disks. - Type
select disk 0(use the correct number). - Type
cleanto erase it (only if you are sure). - Type
convert gptfor modern UEFI systems. - 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
- Press Shift + F10 (or Shift + Fn + F10) during Setup.
- Or use Repair your computer > Troubleshoot > Command Prompt.
- Use tools like diskpart, notepad, and robocopy carefully.
- Type
exitto return to Setup.

Kermit Matthews is a freelance writer based in Philadelphia, Pennsylvania with more than a decade of experience writing technology guides. He has a Bachelor’s and Master’s degree in Computer Science and has spent much of his professional career in IT management.
He specializes in writing content about iPhones, Android devices, Microsoft Office, and many other popular applications and devices.