How To Install Windows on Another Disk Using WinToDisk (Windows Batch Script)

Automating Windows installation on a secondary disk can save time and reduce errors. This guide explains how to use the WinToDisk batch script for clean deployments on both UEFI/GPT and BIOS/MBR systems.

Key Features

  • Automated Partitioning: Handles UEFI (GPT) and legacy BIOS (MBR) layouts.
  • Image Application: Applies install.wim or install.esd directly via DISM.
  • Boot Configuration: Automatically configures boot files using BCDBOOT.
  • Recovery Environment: Sets up and configures WinRE.

Pre‑Run Configuration

  • Section 2.1: Change temporary drive letters if W, Y, or U are already in use.
  • Section 2.2: Adjust partition sizes (e.g., larger EFI partition for multi‑booting).

How It Works – Step by Step

  1. Admin Elevation: Requests administrator privileges.
  2. Drive Letter Check: Ensures temporary letters aren’t in use.
  3. Image Detection: Verifies the Windows image and edition index.
  4. Disk Selection: Lists available disks, blocks system disk.
  5. Firmware Choice: Select UEFI (GPT) or BIOS (MBR).
  6. Partitioning: DiskPart creates the layout automatically.
  7. Image Application: DISM applies the Windows image.
  8. Bootloader Setup: BCDBOOT writes boot files.
  9. Recovery Configuration: WinRE is set up.
  10. Cleanup: Temporary drive letters removed.

Quick Start Guide

  • Connect the target disk (HDD/SSD).
  • Download the WinToDisk script from GitHub.
  • Prepare the Windows image:
    • Download a Windows ISO from Microsoft.
    • Mount the ISO and locate install.wim or install.esd in sources.
    • Example: F:\sources\install.wim.

Run the Script

  • Right‑click and select Run as Administrator.
  • Provide the image path (e.g., F:\sources\install.wim).
  • Select the Windows Edition index.
  • Select the target disk (system disk is protected).
  • Select boot mode (UEFI/GPT or BIOS/MBR).
  • Wait for the script to finish applying the image, configuring boot, and recovery.

Boot from the New Drive

  • On the same PC: set the new disk as the first boot device in BIOS/UEFI.
  • For clients: connect the drive and boot.

On first boot, Windows continues with OOBE (Out‑of‑Box Experience) for region, keyboard, and account setup.

Verify Recovery

reagentc /info

Confirm WinRE is enabled. If disabled, run reagentc /enable.

Important Notes

  • WinRE setup disables and re‑enables recovery to ensure proper configuration.
  • Incorrect linking may occur if WinRE is tied to the Windows partition instead of the recovery partition.
  • Always verify scripts downloaded from the internet. Inspect the code or use AI tools to audit for safety.

This script provides a streamlined, automated way to deploy Windows on a secondary disk, ensuring proper partitioning, boot configuration, and recovery setup.

By following these steps, you can achieve a clean, reliable installation process that mirrors official Windows Setup while saving time and effort.

Post a Comment

Previous Post Next Post

Contact Form