1

I'd like to install a WinPE-based Windows 10 system on an internal hard drive as an emergency system, for example Sergei Strelec's Win10PE, Hiren’s BootCD PE, Win10XPE or similar.

However, I'd like it to be persistent, i.e. not boot from RAM and lose all changes made after shutdown. This way, I'd be able to install programs, drivers etc. to that WinPE system.

It is somewhat similar as described here with respect to a Linux system. Other than there however, I want to install the system on a hard drive.

How do I go about to make such an installation, is there any tool available?

I found this, but am not sure if this is what I'm trying to do -- or whether there shouldn't be an easier way.

19
  • 1
    Windows PE works so well for recovery precisely because it is not installed. You should reconsider.
    – Daniel B
    Jul 2, 2021 at 21:58
  • Not helpful because doesn't answer the question -- other than "don't do it"
    – David.P
    Jul 3, 2021 at 12:28
  • 1
    You’re right, it’s not an answer. That’s why it’s not in the answer section but the comment section. // The guide you found looks good by the way, so just try it. You won’t find a simpler solution.
    – Daniel B
    Jul 3, 2021 at 13:13
  • 1
    It is not installed (as this question asks) though. It remains a WIM image.
    – Daniel B
    Jul 4, 2021 at 13:32
  • 1
    Don’t be difficult. It’s literally in the question title. The question further elaborates that it should not boot from a RAM disk.
    – Daniel B
    Jul 4, 2021 at 15:00

3 Answers 3

2

Okay, somehow this is dead-easy, once you get the hang of it, and using the right tools.

There is DISM++, a truly awesome universal deployment tool that can directly "apply" (i.e. install) a bootable system from an image file to a hard drive:

Choose "File" -> "Apply Image" in DISM++

"Apply Image", i.e. install image to drive by DISM++

For example, using a .wim file from a bootable WinPE USB stick. I tried this with Sergei Strelec's Win10PE system, and it instantly worked -- after making the SSD (where I installed the WinPE to using DISM++) bootable with EasyBCD. The latter should not even be necessary because DISM++ should be able to do this itself, but for some reason it didn't in my case.

Make Hard drive H: bootable using EasyBCD

In other words, Dism++ allows going directly from a WinPE's .wim image to the flat-installed bootable HD system without having to boot the WinPE into RAM first and then pulling an image from the RAM drive as described here; same goes for bootable ISO images like for example all sorts of Windows installation disk images.

Anyway, Sergei Strelec's WinPE then booted straight from the hard drive, assigning itself the X: drive letter, however not to the usual RAM drive, but to the hard drive it was installed to.

I then installed a couple of drivers, for example for a Wifi card which instantly worked. Unfortunately, the system however wouldn't accept GPU drivers. Also, it wouldn't reboot afterwards but give a bluescreen. Anyway, proof of concept almost complete here.

Then, using the same approach ("Apply Image" by DISM++), I installed a Win7 ISO directly on that internal SSD, going from Dism++'s install command to a running Windows 7 in like five minutes. No need for EasyBCD here, DISM++ does it all by itself.

Similar with Windows 11. From clicking "Apply Image" in DISM++ to a running Win11 system in about five minutes.

3
  • This comment is besides the point, because the question is not about a) running b) WinRE c) volatile d) from RAM -- but about a) flat-installing b) WinPE-varieties c) persistent d) on HD.
    – David.P
    Jul 4, 2021 at 14:16
  • Nope. Rather, it appears that you deliberately keep misinterpreting the question and trying to explain something that wasn't asked.
    – David.P
    Jul 4, 2021 at 14:45
  • Someone deleting (their own?) comments by the bulk here. Oh well
    – David.P
    Jul 4, 2021 at 15:41
0

UPDATE 2

Eh, after some (re)search, Microsoft has an official way to install winpe on a hard drive

official link: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-install-on-a-hard-drive--flat-boot-or-non-ram

The problem with UPDATE1 is that I formatted the empty disk as ntfs, it should be fat32, and should not be too large.

I tested the official method, it boots ok.

UPDATE1:

To write winpe to a hard disk without dism++. (have some problems)

Suppose you have an empty disk p

Write the .wim image

dism.exe /apply-image /imagefile:d:\sources\boot.wim /index:1 /applydir:p:\

Make it bootable

bcdboot.exe p:\Windows /s p: /f bios

The hard disk p can boot with ubuntu grub, it will show an error, but will continue to boot normally

enter image description here enter image description here

However, it can't boot independently, it says no bootable device. I think this where dism++ does the trick.

I try to search if dism++ is open source, it's not. so that's it.

Earlier commment, still true:

I make a winpe virtual machine with dism++ suggested by david-p.

But beside that, winpe seems can't do too much, it's just a mini, reducted version of windows.

Most settings made in winpe are not permanent, I don't try neither, because it's not worth it.

You can't install ssh server on winpe, no telnet server neither.

No static ip address, althogh you can configure it, but it's not permanent.

Winpe is a good learning tool, at least you don't need a licence to activate.

Above all, it's very reducted, can't do too much.

0
0

To apply a pre-built WinPE boot.wim/winre.wim to a partition:

  1. Ensure correct image [index] is being applied:
    Dism /Get-ImageInfo /ImageFile:"Z:\boot.wim"
    
  2. Apply image:
    Dism /Apply-Image /ImageFile:"Z:\boot.wim" /Index:1 /ApplyDir:"Y:" /CheckIntegrity /Verify
    
  3. Add a boot entry for WinPE to the BCD store when booted to:

Create WinPE Image

  • Build your own (see below)
    (often more storage efficient and doesn't add significant time)
  • Customize an existing Recovery\WindowsRE\winre.wim
    (WinRE is WinPE with two required OCs: WinPE-Rejuv & WinPE-SRT)
  • Create one using WinPESE, which creates a normal Windows GUI within WinPE


PreReqs for Building/Customizing WinPE:

  1. Install Windows ADK and WinPE files:
    1. ADK 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:\WinPE\OCs" "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\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"
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\WinPE-WMI_en-us.cab"
        
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\WinPE-NetFx.cab"
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\WinPE-NetFx_en-us.cab"
        
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\WinPE-Scripting.cab"
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\WinPE-Scripting_en-us.cab"
        
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\WinPE-EnhancedStorage.cab"
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\WinPE-EnhancedStorage_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"
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\WinPE-Dot3Svc_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"
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-rndis_en-us.cab"
        
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\winpe-wds-tools.cab"
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-wds-tools_en-us.cab"
        
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\winpe-wifi-package.cab"
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-wifi-package_en-us.cab"
        
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\winpe-powershell.cab"
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-powershell_en-us.cab"
        
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\winpe-dismcmdlets.cab"
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-dismcmdlets_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"
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-securebootcmdlets_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"
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-rejuv_en-us.cab"
        
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\winpe-srt.cab"
        Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\WinPE\OCs\en-us\winpe-srt_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: set to Performance by adding 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. Apply WinPE image via Dism or create boot media via MakeWinPEMedia:
    • Partition:
      Dism /Apply-Image /ImageFile:"C:\WinPE\media\sources\boot.wim" /Index:1 /ApplyDir:"Y:" /CheckIntegrity /Verify
      
    • ISO: (via OsCdImg)
      MakeWinPEMedia /Iso "C:\WinPE" "C:\WinPE\WinPE.iso"
      
    • USB:
      MakeWinPEMedia /Ufd "C:\WinPE" F:
      
    • WinRE Replacement: (Windows Recovery Environment)
      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
1
  • 1
    I don't know why this was downvoted...it may be longwinded, but it's the more-or-less correct answer as published by MS....even to the point of recovery integration.
    – Clay
    Sep 25, 2021 at 15:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .