15

I have already read How to write bootable iso to a partition? and How do I place a bootable ISO on a USB drive?, but here it's a bit different:

I'd like to put the Windows 10 (or 7) bootable ISO installation disk into an external disk partition (and not into a USB flash drive). How to do this?

More generally, how to write a bootable ISO to a disk partition with Windows?

Notes:

  • The latter is important because the main solutions of How do I place a bootable ISO on a USB drive? don't work: Rufus, for example, doesn't offer the possibility to do it on a hard drive partition (I just tried now, the "Device" list is empty ; when I insert a USB flash drive, here it works)

  • If possible, I'd like to install the bootable Windows 10 installer ISO into (bootable) Partition 2 of a disk. Partition 1 of the same disk is where Windows will be eventually installed ; once it will be installed, I will be able to delete this no-longer needed Partition 2.


Why to do this? Here's the reason: I've installed Windows many many times, but at the end it's always slow from a USB flash drive. A nice solution would be: put the ISO installer on Partition 2 of the actual disk where it's going to be installed, then boot on this Partition 2, and install Windows on Partition 1. Then you can remove Partition 2. It should be very fast, in the case it's a SSD for example.

Basj
  • 2,143

5 Answers5

16

Rufus developer here.

There's a non publicized cheat mode in Rufus that may allow you to use an external non USB drive like an external USB one, and that's Ctrl-Alt-F. Basically what this does is that it might enable Rufus to list drives that are seen as removable/hot-plug by Windows, regardless of whether they are USB based. Thus, provided that your BIOS/UEFI firmware properly tags them (you may have to fiddle with your BIOS options for that, but be mindful that not all BIOSes allow you to do that), you might be able to use an e-SATA drive.

Now, here comes the BIG DISCLAIMER: The reason why this is a non publicized option is because you will receive absolutely no support regardless of whether the option works or not and also and I make also NO GUARANTEE WHATSOEVER that it'll work for the purpose you want. For instance if Rufus happens to destroy valuable data while using Ctrl-Alt-F, you are 100% on your own. YOU HAVE BEEN WARNED.

I will also point out that this will still result in the whole drive being partitioned and reformatted, so it'll only work if you can dedicate a whole drive. If you want partition preservation then you're on your own.

Akeo
  • 7,541
12

After further tests, here is an (easy) working solution:

  • Get a Windows10 ISO from https://www.microsoft.com/fr-fr/software-download/windows10 (it comes with MediaCreationTool.exe), the one I have is 3.23 GB

  • Use 7zip to extract its content to the disk partition you want (I know it might be strange, but it works!)

  • Run diskmgmt.msc and mark this partition as "Active"

  • Reboot the computer and boot on this disk, it works

  • Do the normal installation as usual.

I just installed a Windows 10 that way a few minutes ago.

Basj
  • 2,143
3

"dd" would work well in this task (writing an ISO file to a partition). I don't know if it has a Windows version or not, but you can boot your computer with a Linux Live usb, then use the "dd" tool from there.

Ben L
  • 131
2

Based on @Basj answer and my attempt. This probably only applies if you want to do a clean install of Windows 11 from Windows 10 without an USB drive.

If you are booting from and efi capable bios on a gpt partition:

  • create a NTFS partition on one of your hard drives that is using GPT partition mode
  • double click on the iso image to mount it
  • copy all files and paste them into the partition that you created

I was surprised to see that this works. I have no idea why given that the partition I created is not even marked as an EFI partition.

1

The Windows ADK (Win7: AIK) and WinPE files are required for creating the bootable WinPE UFD filesystem, as an extracted ISO won't work on its own since it's the sources\boot.wim that's being booted:

  • You can try copying the ISOs contents to a partition and adding the boot.wim to the BCD Store via BcdEdit, however the correct way to do this is the steps below
    • This is not recommended, as Windows becomes a dual-boot setup when adding a bootable WIM to the BCD store; every boot will ask you to choose which install to boot to
  • Windows auto-configures WinRE [Windows Recovery Environment] during the OS install, which can be booted to in numerous ways that do not rely on the BCD Store

The most efficient way to accomplish what's asked is to perform the steps below, as MakeWinPEMedia will create a bootable partition not reliant on the BCD Store that can be selected from the BIOS/UEFI boot menu.


General Info:

WinPE is a self-contained boot WIM [Windows IMage] containing WinPE OCs [Optional Components]:

  • WinPE-Setup is required for Windows Setup, which has seven configuration passes:
    • Upon selecting Install: windowsPE
    • Setup boots to WinPE: offlineServicing
    • Setup boots to Windows: specialize, auditSystem, auditUser, oobeSystem

There are two routes for customizing a WinPE boot.wim/WinPE.wim/WinRE.wim:

  • Build your own:
    • Recommended over customizing an existing custom WIM, as it's more storage efficient and doesn't add a significant amount of time to customization

  • Create one using WinPESE, which creates a normal Windows GUI within WinPE:
    • Cons: the WinPE.wim/WinRE.wim balloons from ~320MB to ~1.5GB+, and the larger the WIM, the longer it takes to boot it, as all data within the WIM has to be mounted to a RAM disk [X:]
    • Pros: Offers a whole host of advanced troubleshooting tools and, if regularly capturing WIMs of the C: partition, allows for basic work to still be done while booted to WinPE


PreReqs:

  1. Install the Windows ADK and WinPE files:
    1. ADK (Win7: AIK) for the version of Windows installed
      (Setup: Windows Preinstallation Environment)
    2. ≥ v1809: Windows PE Add-On is separate
      (ADK still required)
  2. Open an Admin terminal: WinKey+RpowershellCtrl+Shift+OK
    1. Update system PATH:
      (Update paths accordingly if not using Win10 or an x64 OS)
      Cmd /c Setx /M Path "%PATH%;C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools;C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\BCDBoot;C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM;C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg;C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\WSIM;C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment;"
      
    2. Close, then reopen, the Admin terminal to reload $env:PATH


Build WinPE Filesystem

  1. Required:
    1. Mount WinPE boot image:
      # Load ADK variables:
        Cmd /K "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\DandISetEnv.bat"
      

      Copy WinPE files to working directory C:\WinPE:

      CopyPE amd64 "C:\WinPE"

      Mount WinPE WIM:

      Dism /Mount-Image /ImageFile:"C:\WinPE\media\sources\boot.wim" /Index:1 /MountDir:"C:\WinPE\mount"

    2. Add WinPE Optional Components:
      # Create OCs directory link in working directory C:\WinPE:
        MkLink /J "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs" "C:\WinPE\OCs"
      

      Add OCs: (OC and language CABs required for each OC)

      Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs<name>.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us<name>_en-us.cab"

      The following are the minimum I recommend:
      (dependencies exist, add in the order listed)
      • PreReqs:
        WinPE-WMI.cab, WinPE-NetFx.cab, WinPE-Scripting.cab
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\WinPE-WMI.cab.cab"
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\WinPE-WMI.cab_en-us.cab"
        

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\WinPE-NetFx.cab.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\WinPE-NetFx.cab_en-us.cab"

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\WinPE-Scripting.cab.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\WinPE-Scripting.cab_en-us.cab"

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\WinPE-EnhancedStorage.cab.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\WinPE-EnhancedStorage.cab_en-us.cab"

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\WinPE-FMAPI.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\WinPE-FMAPI_en-us.cab"

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\WinPE-SecureStartup.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\WinPE-SecureStartup_en-us.cab"

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\WinPE-Dot3Svc.cab.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\WinPE-Dot3Svc.cab_en-us.cab"

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\winpe-pppoe.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-pppoe_en-us.cab"

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\winpe-rndis.cab.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-rndis.cab_en-us.cab"

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\winpe-wds-tools.cab.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-wds-tools.cab_en-us.cab"

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\winpe-wifi-package.cab.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-wifi-package.cab_en-us.cab"

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\winpe-powershell.cab.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-powershell.cab_en-us.cab"

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\winpe-dismcmdlets.cab.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-dismcmdlets.cab_en-us.cab"

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\winpe-platformid.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-platformid_en-us.cab"

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\winpe-securebootcmdlets.cab.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-securebootcmdlets.cab_en-us.cab"

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\winpe-storagewmi.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-storagewmi_en-us.cab"

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\winpe-rejuv.cab.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-rejuv.cab_en-us.cab"

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\winpe-srt.cab.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-srt.cab_en-us.cab"

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\winpe-winrecfg.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-winrecfg_en-us.cab"

        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\winpe-setup.cab" Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-setup_en-us.cab"

    3. Set WinPE default temp space to 512MB: (default: 32MB)
      Dism /Set-ScratchSpace:512 /Image:"C:\WinPE\mount"
      


  1. Optional - Add custom:
    1. Drivers: (Network drivers)
      Dism /Add-Driver /Image:"C:\WinPE\mount" /Driver:"C:\Path\to\driver.inf"
      
    2. Files/directories: Copy to C:\WinPE\mount
      • QDir Portable provides an Explorer-like GUI with advanced functionality and is highly customizable via its Q-Dir.ini
      • Enable to view hidden files in WinPE's SYSTEM Registry hive:
        # Load WinPE SYSTEM hive:
          Reg Load HKLM\WinPE "C:\WinPE\mount\Windows\System32\config\SYSTEM"
        

        Show hidden files:

        Reg Add HKLM\WinPE\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v Hidden /t REG_DWORD /d 1 Reg Add HKLM\WinPE\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v ShowSuperHidden /t REG_DWORD /d 1

        Show file extensions:

        Reg Add HKLM\WinPE\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v HideFileExt /t REG_DWORD /d 0

        Unload Hive:

        Reg Unload HKLM\WinPE

    3. Startup scripts to: C:\WinPE\mount\Windows\System32\Startnet.cmd
    4. Startup apps (such as QDir) to: C:\WinPE\mount\Windows\System32\Winpeshl.ini
    5. Background:
      1. Change permissions of C:\WinPE\mount\Windows\System32\winpe.jpg:
        # Change ownership to the Administrators group:
          TakeOwn /A /F "C:\WinPE\mount\Windows\System32\winpe.jpg"
        

        Give Administrators group Full permissions:

        Icacls "C:\WinPE\mount\Windows\System32\winpe.jpg" /SetOwner Administrators

      2. Replace winpe.jpg with a custom .jpg
    6. Power Scheme: for Performance, add to C:\WinPE\mount\Windows\System32\startnet.cmd:
      powercfg /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
      


  1. If needed, apply any .msu updates to WinPE from the Microsoft Update Catalog:
    # Add update package:
      Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\windows10.0-kbxxxxx.msu"
    

    Lock in the update:

    Dism /Cleanup-Image /Image:"C:\WinPE\mount\Windows" /StartComponentCleanup /ResetBase


  2. Commit changes, unmount, and export image:
    # Optimize:
      Dism /Cleanup-Image /Image:"C:\WinPE\mount" /StartComponentCleanup /ResetBase
    

    Unmount:

    Dism /Unmount-Image /MountDir:"C:\WinPE\mount" /Commit

    Export:

    Dism /Export-Image /SourceImageFile:"C:\WinPE\media\sources\boot.wim" /SourceIndex:1 /DestinationImageFile:"C:\WinPE\WinPE_Custom.wim" /DestinationName:"Customized WinPE & Includes: QDir, Show Hidden Files" /Compress:Max /Bootable /CheckIntegrity

    Replace original:

    Del "C:\WinPE\media\sources\boot.wim" Copy "C:\WinPE\WinPE_Custom.wim" "C:\WinPE\media\sources\boot.wim"


  3. Create WinPE boot media via MakeWinPEMedia:
    • Partition or USB:
      MakeWinPEMedia /Ufd "C:\WinPE" F:
      
    • WinRE Replacement:
      Required: WinPE-Rejuv & WinPE-SRT
      1. Mount WinRE partition:
        DiskPartLis VolSel Vol #Assign Letter=ZExit
      2. Configure WinRE: [ReAgentC]
        # Disable WinRE:
          ReAgentC /Disable
        

        Copy modified WinPE WIM to Recovery partition:

        Del "Z:\Recovery\WindowsRE\WinRE.wim" Copy "C:\WinPE\media\sources\boot.wim" "Z:\Recovery\WindowsRE\WinRE.wim"

        Set WinRE Path:

        ReAgentC /SetREimage /Path "Z:\Recovery\WindowsRE"

        Enable WinRE:

        ReAgentC /Enable

        Verify:

        ReAgentC /Info

      3. Unmount WinRE partition: DiskPartSel Vol ZRemoveExit
    • ISO: (via OsCdImg)
      MakeWinPEMedia /Iso "C:\WinPE" "C:\WinPE\WinPE.iso"
      
JW0914
  • 9,096