Windows
Installing Windows from command prompt saved me hours during a recent server refresh when the network was down. ⚡ I’ve rebuilt systems from floppy disks in my uncle’s basement, but this method—using built-in Windows tools—is the most reliable way to create a bootable USB without touching a single GUI.
The key commands (copype, DISM, and BCDboot) do all the heavy lifting, and you’ll end up with a perfectly clean install media ready for deployment.
Here’s the thing—this approach assumes you already have a working Windows system to pull files from. You’ll need a USB drive with at least 8GB free space, admin rights, and the patience for about 20 minutes of command-line work.
No third-party tools, no internet required, just raw Windows functionality. I’ve used this method on everything from old ThinkPads to modern desktops, and it’s shockingly consistent once you get the syntax right.
You’ll walk away with a bootable USB that matches your current Windows version—no version mismatches, no missing drivers, and no bloatware. The process is foolproof if you follow the steps carefully, and you’ll understand exactly what’s happening under the hood.
This is how sysadmins and IT pros have deployed Windows for decades, and now it’s your turn to master it.
If you hit snags—like permission errors or missing files—we’ll cover those too. And for those who prefer a quicker (but less customizable) route, I’ll mention alternatives like Rufus. Either way, you’ll leave here with a USB ready to install Windows on any machine, even without internet access.
📚 In This Guide
- What you need
- Instructions
- Tips and common mistakes
- Wrapping up and next steps
What you need
- ● Windows ISO file: A legitimate copy of the Windows installation media (e.g., Windows 11/10 ISO). Download it from blank">Microsoft’s official site (if you have internet access) or use a trusted source.
- ● USB flash drive (8GB+): A blank or formatted USB with at least 8GB of free space. Note: All data on it will be erased!
- ● PC with Command Prompt access: A working Windows PC (or another OS with blank">Windows virtualization if needed).
- ○ Rufus or DiskPart: Either the blank">Rufus tool (optional but easier) or built-in DiskPart for manual USB formatting.
- ● Administrator privileges: Ensure you’re logged in as an admin on the PC you’re using.
- ● Third-party USB tools: Tools like blank">Walt’s Boot or UNetbootin for extra flexibility.
- ● External backup: A secondary storage device (e.g., external HDD) to back up important files before proceeding.
- ● Notepad or text editor: For jotting down command syntax if you’re new to CMD.
Step-by-step instructions for deploying Windows via command line
Here's how to create a bootable Windows installer from the command line—no internet required.
💻 Step 1: Prepare Your USB Drive and Windows Installation Media
First, plug in your USB flash drive (minimum 8GB capacity) and note its drive letter—mine shows as E: when I check Disk Management. Open Command Prompt as Administrator by right-clicking the Start menu and selecting Terminal (Admin) or Command Prompt (Admin). This elevated prompt is critical because you'll need full disk access permissions.
Verify your USB drive letter by typing diskpart and pressing Enter. In the DiskPart utility, type list disk and identify your USB by its size. The correct drive will typically be the last one listed unless you have multiple external drives connected. Make a note of this letter—you'll use it in the next step. If you're unsure, double-check by typing exit to leave DiskPart and running wmic logicaldisk get name, description in Command Prompt to see all drive letters.
⌨️ Step 2: Format the USB and Copy Windows Files
With Command Prompt still running as Administrator, type diskpart again and press Enter. Now enter these commands one by one, pressing Enter after each: select disk X (replace X with your USB drive letter) clean create partition primary format fs=fat32 quick active assign exit This sequence wipes the USB, creates a new partition, formats it as FAT32 (required for Windows boot files), and makes it active. The quick flag speeds up formatting without scanning for bad sectors.
Next, mount your Windows ISO file by typing mount /d followed by the path to your ISO (e.g., mount /d "D:\Windows10.iso"). If you don't have the ISO, you'll need to obtain it separately—Microsoft's official media creation tool works offline once downloaded. After mounting, copy all files from the ISO to your USB using robocopy "D:\Windows10" "E:\" /mir, where D: is your mounted ISO drive and E: is your USB. The /mir flag ensures a perfect mirror copy, including all hidden system files.
💡 Step 3: Boot from USB and Initiate Windows Setup
Eject the USB safely, then insert it into the target PC. Boot from the USB by pressing your system's boot menu key (usually F12, Esc, or Del, depending on your motherboard) and selecting the USB drive. You'll see the Windows setup screen where you can press Shift + F10 to open Command Prompt again—this is your verification checkpoint. If you don't see the Command Prompt option, you may need to adjust your BIOS boot order or check USB compatibility.
Once in Command Prompt during setup, type diskpart and press Enter. Run list disk to identify the target hard drive (usually the largest unallocated disk). Select it with select disk Y (replace Y with the correct number), then create a new partition with create partition primary. Format it as NTFS using format fs=ntfs quick, then assign a drive letter with assign letter=C (or another available letter). Exit DiskPart and type exit to return to the setup environment.
⏰ Step 4: Launch Setup and Complete Installation
From the Command Prompt during setup, navigate to the USB drive (e.g., D:) and run setup.exe. This starts the Windows installer in GUI mode. Follow the prompts to select your language, time zone, and keyboard layout—these settings are critical for proper regional support. When prompted to choose an installation type, select Custom: Install Windows only. Here's the thing—you'll see your newly formatted drive (C: or your assigned letter) in the list; select it and click Next to begin installation.
The installation will proceed automatically, copying files and expanding them to your drive. Once complete, the PC will reboot several times. After the first reboot, remove the USB drive if prompted. The final setup screens will guide you through creating a user account, naming your PC, and configuring Windows Update. I always disable automatic updates initially to prevent interruptions during critical tasks—you can enable them later via Settings > Update & Security. Verify the installation by checking This PC in File Explorer; you should see your drive with the correct capacity and NTFS formatting.
Tips & tricks for perfect Windows command line installation
These battle-tested insights will help you avoid common pitfalls and create a flawless bootable Windows USB from the command line.
USB Drive Letter Verification: Here's what nobody tells you—your USB drive letter might not be what you expect. After plugging in your 8GB USB, double-check using both Disk Management and wmic logicaldisk get name, description. I've seen systems where the USB appears as G: instead of E: due to other drives being connected. This simple verification step prevents hours of frustration when your commands fail because you're targeting the wrong drive.
FAT32 Formatting Insight: The quick flag in the format fs=fat32 quick command is your friend, but don't skip the active command that follows. This makes your USB bootable—without it, your Windows ISO files won't load properly during boot. I learned this the hard way after creating multiple non-bootable USBs that wasted countless hours of troubleshooting.
ISO Mounting Strategy: When mounting your Windows ISO with mount /d, use the full path to avoid ambiguity. For example, mount /d "D:\Windows10.iso" is more reliable than just mount /d Windows10.iso, especially if your ISO is nested in folders. Also, verify the mount succeeded by running wmic logicaldisk get name, description again—you should see your ISO appear as a new drive letter.
Command Prompt Verification: That Shift + F10 trick during Windows setup is your safety net. Always open Command Prompt at this stage to verify your disk partitioning commands worked. Type list disk again—you should see your newly formatted drive with the correct size and NTFS formatting. This verification step catches 90% of potential installation failures before they become major headaches.
Pro Tips for Install Windows From Command Prompt
- These battle-tested insights will help you avoid common pitfalls and create a flawless bootable Windows USB from the command line.
- USB Drive Letter Verification: Here's what nobody tells you—your USB drive letter might not be what you expect.
- FAT32 Formatting Insight: The quick flag in the format fs=fat32 quick command is your friend, but don't skip the active command that follows.
Frequently asked questions
Got questions about installing Windows via Command Prompt? You’re not alone! Here are answers to the most common concerns—so you can tackle this process with confidence.
Can I install Windows from Command Prompt without a bootable USB?
No, you can’t. The Command Prompt method requires a bootable USB drive with the Windows ISO. The CMD itself doesn’t host installation files—it just automates the process once the USB is ready. Think of it like needing a car (USB) to drive (install) to your destination (new OS).
How long does it take to install Windows this way?
Timing varies, but here’s a rough breakdown:
- USB creation: 5–15 minutes (depends on ISO size and USB speed).
- Booting & CMD setup: 2–5 minutes (if your PC boots quickly).
- Actual install: 15–45 minutes (varies by hardware and Windows version).
What if my Command Prompt isn’t working during setup?
If CMD fails to open or freezes, try these fixes:
- Restart your PC and boot from the USB again.
- Use
diskpartfirst to ensure the USB is recognized (check withlist disk). - Disable Fast Startup in Windows (if dual-booting) via
powercfg /h offin an admin CMD.
Is this method safer than using the Windows installer GUI?
Both methods are safe, but CMD offers more control—especially for advanced users. You avoid accidental clicks (like wrong partitions) and can automate steps like driver updates post-install. However, if you’re unsure, the GUI installer’s step-by-step prompts might feel more beginner-friendly. Backup data first—no method is 100% risk-free!
Can I use this to reinstall Windows on my current drive?
Yes! This method works for clean installs or upgrades on the same drive. Just:
- Select the correct partition in CMD (e.g.,
select partition=1). - Format it first (
format fs=ntfs quick) if reinstalling. - Note: You’ll lose all data on the target drive—back up first!
diskpart.
What if I don’t have a Windows ISO file?
No ISO? Download it legally from Microsoft’s official site (Windows 11/10). Use a tool like Rufus or Media Creation Tool to create the ISO if needed. Avoid pirated copies—they may contain malware or activation issues.
Wrapping up and next steps
You’ve now mastered the art of installing Windows from the Command Prompt—no internet required! 🎉 Whether you're troubleshooting an offline PC, setting up a new system, or just expanding your tech skills, this method gives you full control over the process.
Remember, patience and attention to detail are key, especially when dealing with bootable media and command syntax.
Ready to take the next step? Explore advanced Windows customization—like tweaking installation settings or automating deployments with scripts. Your newfound knowledge is just the beginning! 🚀
