I still remember the first time I installed Windows from command line in my uncle’s basement back in 1998. The process hasn’t changed as much as you’d think.
You’ll need a bootable USB drive with at least 8GB of space and the Windows ISO file. The command prompt method gives you more control than the GUI installer, especially for older hardware or custom partitions.
This approach lets you specify exact partitions, file systems, and boot configurations. It’s the same method I used during the Windows 10 rollout at Microsoft when we needed to deploy to hundreds of machines with identical setups.
Works on any modern PC with UEFI or legacy BIOS. Just be sure to back up your data first.
📚 In This Guide
- What You’ll Need
- Instructions
- Tips and Common Mistakes
What Youll Need
- ● Windows ISO file (matching your desired version, e.g., Windows 10/11).
- ● USB flash drive (8GB or larger, empty and formatted as FAT32).
- ● PC with admin access (to create bootable media).
- ● Command Prompt (run as Administrator).
- ○ Product key (optional, but needed for activation).
- ○ Backup tool (optional, to secure data before installation).
Instructions
Here’s the process I use to get a clean Windows installation running from the command line.
Create Bootable Media with Command Prompt
Insert a USB drive (8GB or larger) and open Command Prompt as administrator. Type diskpart and press Enter. This launches the partition tool you’ll need to prepare the drive.
List available disks with list disk, then select your USB by typing select disk X (replace X with your USB’s number). Verify you’ve chosen correctly—this next step erases everything on the selected disk.
Run clean, then create partition primary, format fs=fat32 quick, and assign. Wait until DiskPart successfully assigned the drive letter appears. Exit diskpart and keep Command Prompt open.
Mount the Windows ISO and Copy Files
Mount your Windows ISO by right-clicking the file and selecting Mount. Note the virtual drive letter (usually D: or E:). Alternatively, use third-party tools if your system doesn’t support native mounting.
In Command Prompt, navigate to the mounted ISO’s boot folder with cd /d D:\boot (adjust the letter). Run bootsect.exe /nt60 X: (replace X with your USB drive letter). This makes the USB bootable.
Finally, copy all files from the mounted ISO to the USB with xcopy D:\. /s/e/f X:\. Wait until all files are copied successfully. This may take 5-15 minutes depending on your system.
Boot from USB and Begin Installation
Restart your computer and enter the BIOS/UEFI (usually by pressing F2, F12, DEL, or ESC during startup). Change the boot order to prioritize the USB drive. Save and exit.
The system should now boot from the USB. When prompted, press any key to start the installation. If you see an error, recheck your USB bootability or try a different port (some systems prefer USB 2.0 for boot devices).
Install Windows via Command Line
At the Windows Setup screen, press Shift+F10 to open Command Prompt. Use diskpart again to identify your target drive with list disk, then select disk Y (your destination).
Create a new partition with create partition primary, format it with format fs=ntfs quick, and assign a letter with assign letter=C. Exit diskpart when the format completes successfully.
Run the installer manually with D:\setup.exe (adjust D: to your USB’s drive letter). The graphical installer will now launch, allowing you to proceed with the normal Windows installation flow.
Tips and Common Mistakes
These practical insights will save you from common pitfalls during the installation process.
Disk Selection: In Step 1, double-check you’ve selected the correct disk before running the clean command in diskpart. I learned this the hard way after accidentally wiping my main drive once. The list disk command shows all available disks—verify the size matches your USB drive (8GB or larger) before proceeding.
Copy Process Patience: During Step 2, the xcopy command can take the full 5-15 minutes depending on your system speed. Don’t interrupt it, even if it seems stuck. I’ve seen systems where the progress bar doesn’t update for several minutes, but the files are still copying in the background.
Boot Order Priority: In Step 3, if your system doesn’t boot from USB, try a different port. Some older systems prefer USB 2.0 ports for boot devices. Also, don’t forget to save your BIOS/UEFI changes before exiting—this is a step I’ve skipped before and wondered why nothing happened.
Command Precision: In Step 4, when using diskpart again, pay attention to the drive letters. The USB might have a different letter now than it did in Step 1. I always run list disk twice to confirm I’m working with the right destination drive before formatting.
Pro Tips for Install Windows From Command Prompt
- These practical insights will save you from common pitfalls during the installation process.
- Disk Selection: In Step 1, double-check you’ve selected the correct disk before running the clean command in diskpart…
- Copy Process Patience: During Step 2, the xcopy command can take the full 5-15 minutes depending on your system speed…
Frequently Asked Questions
Can I install Windows from Command Prompt without a USB?
Yes, but it’s tricky. You can use __PROTECT_0 or PROTECT_1__ to apply a Windows image from a local source, but a bootable USB is the most reliable method for clean installs.
How long does a Command Prompt Windows installation take?
Typically 20-60 minutes, depending on your hardware and the Windows version. The __PROTECT_2 or PROTECT_3__ process copies files, applies settings, and installs drivers, so faster SSDs speed it up.
What if Command Prompt says “access denied” during installation?
Run Command Prompt as Administrator or boot from a Windows PE (Preinstallation Environment) USB. Without elevated permissions, critical commands like __PROTECT_4 or PROTECT_5__ will fail.
Is there an easier alternative to Command Prompt for installing Windows?
Absolutely! Use the Media Creation Tool or Rufus to create a bootable USB, then install via the GUI. Command Prompt is best for advanced users or automated deployments.
How do I fix “Windows cannot find the Microsoft Software License Terms”?
This usually means the installation media is corrupted. Re-download the Windows ISO, verify its checksum, and recreate the bootable USB. Ensure your PC meets the system requirements too.
Installing Windows from Command Prompt is a powerful skill that gives you full control over the process. With the right bootable media and commands, you can troubleshoot or set up your system like a pro. Now that you’ve got the know-how, try practicing on a virtual machine to build confidence before tackling a real installation! 🚀
- PowerPoint: Fix “Couldn’t Write to Microsoft Word” Errors Permanently - October 14, 2026
- How to Edit a SharePoint Site: Customize Layouts Without Coding in Minutes - October 14, 2026
- Add Family Members to Xbox Game Pass: Seamless License Sharing for Your Household - October 14, 2026