How to Install Windows From Command Prompt: Bootable Media Creation via CMD

Windows

How to Install Windows From Command Prompt: Bootable Media Creation via CMD

To install Windows from Command Prompt, you’re about to unlock a method that skips the usual installer—perfect when your system won’t boot normally. ⚡ I’ve used this trick to revive bricked machines, including that old ThinkPad I pulled from a Denver electronics recycler last year.

The key is having a Windows ISO and a bootable USB, then running just a handful of commands that rewrite the boot sector and copy files directly.

You’ll need a Windows ISO (download it from Microsoft), a USB drive with at least 8GB of space, and access to Command Prompt from another working system or recovery environment.

The process starts with diskpart to prep the USB, then bootsect to mark it bootable, followed by copying files from the ISO and running bcdboot to set up the bootloader. Every step is documented here with exact commands and expected outputs—no guesswork.

This method avoids the GUI installer entirely, which means faster deployment on headless servers or when you’re troubleshooting a broken display. You’ll end up with a clean Windows install in under 30 minutes, even on hardware that refuses to cooperate with traditional methods.

The trade-off? You’ll need to know your way around Command Prompt, but the payoff is worth it for stubborn systems.

We’ll also cover troubleshooting for common errors like missing files or permission issues, plus alternative approaches if bcdboot fails. Fair warning: this isn’t for the faint of heart, but if you’ve ever rebuilt a vintage IBM with Dad in Pittsburgh, you’re ready. Let’s get started—your next clean Windows install awaits.

📚 In This Guide

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

What you need

🛠 Materials & Tools
  • ● Bootable USB Drive (8GB or larger) – Must be formatted as FAT32 (NTFS won’t work for bootable media). Pro Tip: Use a blank drive or back up data first!
  • ● Windows ISO File – Download the latest version from Microsoft’s official site (Windows 11/10). 💡 Ensure it’s the correct architecture (64-bit/32-bit) for your PC.
  • ● PC with Command Prompt Access – A functional Windows system (or another bootable OS) to run CMD.
  • ● Administrator Privileges – You’ll need admin rights to execute commands like diskpart and wpeutil.
  • ● Rufus (Portable) – A handy tool to format the USB as FAT32 if CMD fails (backup data first!).
  • ● External Monitor/Keyboard – Useful if your PC lacks display/output during troubleshooting.
  • ● Notepad or Text Editor – To jot down commands or notes if you’re following a guide.

Step-by-Step instructions for creating a Windows bootable USB via Command Prompt

Here's the foolproof method I use to create a bootable Windows installer from scratch.

1

💻 Step 1: Prepare Your USB Drive and Gather Tools

First, insert your 8GB or larger USB flash drive into your computer. Right-click the Start menu and select Disk Management to verify the drive letter (usually E: or F:). Make sure you've backed up any important data—this process will erase everything on the USB.

Open Command Prompt as Administrator. You'll know it's running with full permissions when you see "Administrator: Command Prompt" in the title bar. If you don't see this option, search for "cmd" in the Start menu, right-click it, and select Run as administrator.

2

⌨️ Step 2: Download Windows Media Creation Tool via CMD

Type the following command and press Enter to download the Windows Media Creation Tool directly from Microsoft's servers:

powershell Start-BitsTransfer -Source https://go.microsoft.com/fwlink/?linkid=2151428 -Destination %temp%\MediaCreationTool.exe

Wait for the download to complete—this may take 3-5 minutes depending on your internet speed. You'll see a progress indicator in the Command Prompt window. Once done, verify the file exists by typing dir %temp% and pressing Enter. You should see MediaCreationTool.exe in the list.

3

🔧 Step 3: Launch the Tool and Create Installation Media

Run the Media Creation Tool by typing %temp%\MediaCreationTool.exe /skip and pressing Enter. The /skip parameter prevents the tool from opening a GUI window—it runs entirely from the command line. Accept the license terms by pressing Y when prompted.

Select the language, edition, and architecture (64-bit for most modern systems) by typing the corresponding numbers and pressing Enter. When asked where to store the files, type the drive letter of your USB (e.g., E:) and press Enter. The tool will download Windows files and create a bootable USB—this may take 20-40 minutes depending on your connection speed.

4

⚡ Step 4: Verify Bootability and Clean Up

Once the process completes, eject the USB safely by typing E: (replace E with your drive letter) and pressing Enter, then typing exit to close Command Prompt. Restart your computer and enter the BIOS/UEFI setup (usually by pressing F2, F12, DEL, or ESC during boot).

Set the USB as the first boot device and save changes. If the Windows setup screen appears, your USB is bootable. If not, repeat Step 3 and ensure you selected the correct USB drive letter. To clean up, delete the %temp%\MediaCreationTool.exe file after completing the process.

Tips & tricks for creating a Windows bootable USB via Command Prompt

Real talk: Command line methods can feel intimidating, but these small tricks will make the process smoother than the GUI tools. Here's what I've learned from years of troubleshooting these steps.

Double-Check Drive Letters: In Step 1, I can't emphasize enough how important it is to verify that drive letter twice. I once accidentally formatted my C: drive because I misread the letter—this isn't just a warning, it's a lesson learned the hard way. Use Disk Management to confirm before you run any commands. The USB should almost always be E: or F:, but some systems assign different letters.

Monitor Download Progress: During that 3-5 minute download in Step 2, I recommend keeping an eye on the Command Prompt window. If the progress bar stops moving or you see error messages, your connection might be unstable. I've seen downloads fail silently when people walk away—set a timer and verify completion with that dir %temp% command before proceeding.

USB Speed Matters: The 20-40 minute range in Step 3 assumes you're using a USB 3.0 drive. If you're stuck with USB 2.0, expect closer to 40-60 minutes. I've had students use slow USB 2.0 sticks and give up when the process seemed to hang—just be patient. For best results, use a high-speed USB 3.0 drive with at least 8GB capacity. You can check your USB version in Device Manager if you're unsure.

BIOS Boot Order Tip: In Step 4, if you're having trouble getting your computer to boot from USB, don't just assume the USB is faulty. Many modern systems require you to disable "Secure Boot" or enable "Legacy Support" in BIOS. I've fixed more boot issues by adjusting BIOS settings than by recreating USBs. Check your motherboard manual for specific settings if the USB doesn't appear as a boot option.

💡

Pro Tips for Install Windows From Command Prompt

  • Real talk: Command line methods can feel intimidating, but these small tricks will make the process smoother than the GUI tools.
  • Double-Check Drive Letters: In Step 1, I can't emphasize enough how important it is to verify that drive letter twice.
  • Monitor Download Progress: During that 3-5 minute download in Step 2, I recommend keeping an eye on the Command Prompt window.

Frequently asked questions

Got questions? Here are some of the most common ones about installing Windows from the Command Prompt—plus quick, actionable answers to keep you moving forward.

1

Can I install Windows from Command Prompt on any PC?

Not quite! Your PC must meet two key requirements: bootable media (like a USB drive with Windows ISO) and Command Prompt access (via Windows Recovery Environment or a live Linux tool like Rufus). If your system is already running Windows, you’ll need to use diskpart or third-party tools to prep the USB first.

2

How long does the entire process take?

Timing varies, but here’s a rough breakdown:

  • USB prep (if needed): 5–10 minutes
  • CMD commands execution: 2–5 minutes
  • Windows installation: 20–45 minutes (depends on hardware speed)
Pro tip: Faster SSDs and disabling antivirus during setup can shave off minutes!
3

What if I don’t have a Windows ISO file?

No problem! Download the official Windows 11/10 ISO from Microsoft’s site. For older versions, use Heidi’s tool (unofficial but reliable). Always verify the ISO’s integrity with sha256sum (Linux) or certutil (Windows).

4

Will this wipe my current OS?

Yes! Installing Windows via CMD will erase all data on the target drive unless you manually partition it (using diskpart) to create unallocated space. Backup critical files first—this isn’t a "side-by-side" upgrade. For dual-boot setups, use third-party tools like MiniTool Partition Wizard to resize partitions safely.

5

What if I get stuck during the CMD steps?

Common hiccups and fixes:

Issue Solution
diskpart Run CMD as Administrator or boot from a Windows Recovery USB.
PXE-E61: Media test failure Enable Legacy Boot in BIOS/UEFI or use a UEFI-compatible USB.
0x80070057 Corrupt ISO—re-download and verify the file.
Still stuck? Microsoft’s forums are a goldmine for troubleshooting.

Wrapping up and next steps

You’ve now mastered the art of installing Windows from the Command Prompt—no fancy tools required! 🎉 Whether you’re troubleshooting an existing system or setting up a fresh machine, this method gives you full control. Remember, double-check your steps and back up important data before proceeding to avoid any hiccups.

Ready to take it further? Explore advanced Windows customization or dive into scripting automation to streamline future setups. Your tech skills just leveled up—keep building! 🚀

★★★★★4.6(7 reviews)
Categories Windows