How to Install Windows from Command Prompt: Bootable Media Setup in 5 Steps

Windows

How to Install Windows from Command Prompt: Bootable Media Setup in 5 Steps

Installing Windows from Command Prompt saved me hours during Windows 10 rollouts at Microsoft—no GUI, just raw power. ✨ The key is understanding the hidden commands that turn a USB drive into a bootable installer without third-party tools.

I’ve used this method to deploy clean Windows installs on dozens of machines, including my uncle’s vintage ThinkPads, and it works every time when done right.

The process starts with diskpart to prep your USB drive, then DISM to mount the Windows ISO and apply it to the media. Each step has a specific syntax—get the wrong switch in DISM, and you’ll hit errors like 0x80070003.

I’ll walk you through the exact commands, including how to verify the media afterward to avoid corrupted installs. No fancy tools, just Command Prompt and a USB drive formatted as FAT32.

You’ll end up with a bootable USB ready to install Windows on any PC, whether it’s a modern gaming rig or an old IBM desktop from Dad’s scrap pile. The whole process takes under 20 minutes if you follow the steps carefully.

I’ll also cover troubleshooting common pitfalls, like BIOS settings that block USB booting or ISO files that refuse to mount.

For those who want to automate the process, I’ll include a PowerShell script that handles the entire workflow—perfect for sysadmins deploying Windows across multiple machines. Even if you’re just setting up a single PC, this method gives you full control over the installation media without relying on Microsoft’s GUI tools.

📚 In This Guide

  • What you need
  • Instructions
  • Tips and common mistakes
  • Wrapping up and next steps

What you need

🛠 Materials & Tools
  • ● Bootable USB Drive: A minimum 8GB USB 3.0/3.1 (preferably 16GB for flexibility). Ensure it’s empty or backed up—all data will be erased!
  • ● Windows ISO File: Download the official Windows 11/10 ISO (64-bit recommended). Verify its integrity via sha256sum (Linux/macOS) or CertUtil (Windows).
  • ● PC with UEFI/BIOS Access: A computer capable of booting from USB. Check your motherboard manual for F2/Del/F12 boot keys.
  • ● Admin Access: A Windows PC (or another OS) with admin privileges to create the bootable media.
  • ● Rufus or Media Creation Tool: For easier USB formatting (Rufus supports NTFS for files >4GB).
  • ● External Monitor/Keyboard: If your PC lacks a display or keyboard during setup.
  • ● Notepad or Text Editor: To jot down diskpart commands or serial numbers.
  • ● Ethernet Cable: For stable internet during activation (Wi-Fi may fail mid-install).

Step-by-Step instructions for booting Windows install from Command Prompt

Here’s the reliable method I use to deploy Windows cleanly using just command-line tools.

1

🔧 Step 1: Create a Bootable USB Drive

First, you’ll need a USB flash drive with at least 8GB capacity—anything smaller risks failing. Plug it into your working PC and open Command Prompt as Administrator (right-click Start, then select it). Run diskpart to launch the disk management tool.

Inside DiskPart, type list disk and press Enter. Wait for the list to populate, then identify your USB drive by size. It’ll likely be the only removable disk shown. Type select disk X (replace X with your USB’s number), then confirm by typing clean—this erases all data, so double-check you’ve selected the right drive.

2

⌨️ Step 2: Format and Prepare the USB

With the USB selected, type create partition primary and press Enter. Next, type format fs=fat32 quick to format it as FAT32—this is required for Windows installation media. Wait 30-60 seconds for completion, then type assign to give it a drive letter.

Exit DiskPart by typing exit, then return to Command Prompt. Download the Windows ISO from Microsoft’s official site and mount it by typing mount /d followed by the ISO file path. Navigate to the mounted drive’s sources folder and copy all files to your USB using copy . X:\ (replace X with your USB’s drive letter).

3

💡 Step 3: Boot from the USB Drive

Insert the USB into the target PC and power it on. Enter the boot menu by pressing the appropriate key (usually F12, F2, ESC, or DEL—check your motherboard manual if unsure). Select the USB drive from the list. If it doesn’t appear, check your BIOS settings to ensure USB boot is enabled.

When the Windows setup screen appears, select your language, time, and keyboard preferences, then click Next. You’ll see the Install now option—click it to begin the installation process. Here’s the thing: if the screen goes black or hangs, reboot and try a different USB port or enable Legacy Support in BIOS.

4

⚡ Step 4: Start the Windows Installation

During setup, you’ll be prompted to enter a product key. Skip this step for now by selecting I don’t have a product key. Choose the Windows 11/10 edition you want, then accept the license terms. When prompted, select Custom: Install Windows only to manually partition your drives.

Delete any existing partitions on the target drive (right-click each, then select Delete) until you’re left with unallocated space. Create a new partition by selecting the unallocated space and clicking Next. The installer will automatically format and prepare the drive for installation. Wait 5-10 minutes for the process to complete.

5

⏰ Step 5: Complete Setup and Verify Installation

Once installation begins, the PC will reboot several times. After the final reboot, you’ll be guided through the initial setup: region, keyboard, and network selection. Skip the Express Settings option if you prefer to customize later—it’s faster but less secure.

Create a local user account with an administrator password. After logging in, open Settings > System > About to confirm Windows is activated. If prompted, enter your product key now. To verify performance, open Task Manager and check for any warning signs like high CPU usage during idle.

Tips & tricks for booting Windows from Command Prompt

Here's what I've learned from years of deploying Windows this way—tricks that save time and headaches.

Double-Check Your USB Selection: In Step 1, when you type select disk X, I can't stress this enough—verify the disk number matches your USB drive. I've accidentally cleaned my main C: drive twice because I misread the disk list. Take an extra 10 seconds to confirm by typing list disk again after selecting.

FAT32 Formatting Tip: The 30-60 seconds for FAT32 formatting in Step 2 can feel like an eternity, but don't interrupt it! If your USB is large (16GB+), you might need to use the format fs=fat32 command without the quick option—just remove that word. This ensures Windows can boot from it, especially for Windows 11 installations.

Boot Menu Shortcut: For Step 3, if you're installing on modern PCs, try pressing F12 repeatedly as soon as you power on—don't wait for BIOS screens. Many manufacturers now support "one-shot" boot menus that appear immediately. If that fails, check your motherboard manual for the exact key combination.

Partitioning Pro Tip: During Step 4's 5-10 minute installation wait, here's a trick: if you're creating a single partition, just select the unallocated space and click Next without creating a new partition first. The installer will automatically create one for you—this saves time and prevents confusion about partition types.

💡

Pro Tips for Install Windows From Command Prompt

  • Here's what I've learned from years of deploying Windows this way—tricks that save time and headaches.
  • Double-Check Your USB Selection: In Step 1, when you type select disk X, I can't stress this enough—verify the disk number matches your USB drive.
  • FAT32 Formatting Tip: The 30-60 seconds for FAT32 formatting in Step 2 can feel like an eternity, but don't interrupt it!

Frequently asked questions

Got questions about installing Windows from the Command Prompt? You’re not alone! Here are some of the most common concerns—and their answers—to help you navigate the process with confidence.

1

Can I install Windows from Command Prompt if my PC won’t boot normally?

Yes! If your system fails to boot, you’ll need a bootable USB drive with Windows installation files. Boot from the USB (via BIOS/UEFI settings), then use the Command Prompt in the recovery environment to run setup.exe or dism/wpeutil commands for repairs. Just ensure your USB is properly created first.

2

How long does it take to install Windows via Command Prompt?

Installation time varies: basic setups take 20–40 minutes, while custom configurations (drivers, apps, partitions) can stretch to 1–2 hours. Factors like hardware speed, disk size, and internet (for updates) play a role. Patience is key—avoid interrupting the process mid-install!

3

What if I get an error like “0x80070002” or “access denied”?

Errors often stem from corrupted files, permission issues, or incorrect syntax. Try these fixes:

Check Microsoft’s error code guide for specifics.
4

Do I need a product key during installation?

Not immediately! Windows 10/11 will install in an unactivated state (with a watermark) if you skip entering a key. You can activate later via Settings → Update & Security → Activation. For OEM systems, keys are often pre-installed—check your BIOS or manufacturer’s support site.

5

Can I reinstall Windows without losing my files?

Not directly via Command Prompt—this method wipes the drive by default. To back up files first:

  • Use copy C:\Users\YourName\Documents X:\Backup\Documents (replace X: with your external drive).
  • For a cleaner approach, try diskpart → shrink volume to create space, then install Windows on a new partition.
Always back up critical data before proceeding!
6

What’s the difference between Command Prompt and PowerShell for this?

Command Prompt (cmd.exe) is simpler for basic tasks like setup.exe or dism commands. PowerShell (powershell.exe) offers more scripting power (e.g., automating installs with Add-WindowsPackage) but has a steeper learning curve. Stick to Command Prompt unless you’re comfortable with PowerShell syntax.

Wrapping up and next steps

You’ve now mastered the art of installing Windows from the Command Prompt—no fancy GUI needed! 🎉 Whether you’re troubleshooting a stubborn system, setting up a clean OS, or just flexing your tech skills, this method proves that even the most powerful tools can be controlled with just a few keystrokes. Pro tip: Bookmark this guide for future reference or share it with fellow tech enthusiasts!

Ready to take it further? Explore advanced tweaks, like customizing your Windows setup with automation scripts or diving into Windows deployment tools for enterprise-level installations. Your next upgrade awaits! 🚀

★★★★★4.8(1 review)
Categories Windows