3

I have a bootable flash drive with a WINPE install on it, and I would like to be able to convert said bootable usb to an iso file from a batch or powershell file. I've tried using tools like Folder2iso, but it does not support creating an iso file that is bootable. ImgBurn seemed promising but not matter how much I mess with the config, the iso never boots, plus it is not easy to make portable which is something I need for the program I am creating.

After doing some more digging, I can create an iso like this:

pushd C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg                   
xcopy "F:\" "%temp%\WinPECopy\media\"
xcopy "C:\WinPE_amd64\fwfiles" "%temp%\WinPECopy\fwfiles\"
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\MakeWinPEMedia.cmd" /ISO "%temp%\WinPECopy" "C:\WinPE_Copy.iso"

But then I get the following error: boot This is probably because I added the NET framework and custom files to the USB drive, but used the default unaltered efisys.bin file from C:\WinPE_amd64\fwfiles. You can see this in the CreateWinPEMedia.cmd file here:

:ISOWorker_OscdImgCommand

  rem
  rem Set the correct boot argument based on availability of boot apps
  rem
  set BOOTDATA=1#pEF,e,b"%WORKINGDIR%\%FWFILES%\efisys.bin"
  if exist "%WORKINGDIR%\%FWFILES%\etfsboot.com" (
    set BOOTDATA=2#p0,e,b"%WORKINGDIR%\%FWFILES%\etfsboot.com"#pEF,e,b"%WORKINGDIR%\%FWFILES%\efisys.bin"
  )

  rem
  rem Create the ISO file using the appropriate OSCDImg command
  rem
  echo Creating %DEST%...
  echo.
  oscdimg -bootdata:%BOOTDATA% -u1 -udfver102 "%WORKINGDIR%\%TEMPL%" "%DEST%" >NUL
  if errorlevel 1 (
    echo ERROR: Failed to create "%DEST%" file.
    goto fail
  )

Anyone know how I can get around this? I tried deleting the etfsboot.com file since it seems to handle whether or not the file is there, but then I get the Failed to boot: No bootable medium found. error.

Another update

I think I'm on to something, as I figure this out I'm seeing that this is sort of an XY question (pointed out by @Biswapriy). I think I can make it not an XY question but I have to do a bit more research first.

So far I'm thinking:

setps:
1. Mount the USB Drive
2. Copy everything to a folder (backup2 script)
3. unmount the usb drive
4. Create new WinPE base: copype amd64 C:\WinPE_ISO_START
5. mount the new image: dism /Mount-Image /ImageFile:"C:\WinPE_ISO_START\media\boot.wim" /index:1 /MountDir:"C:\WinPE_ISO_START\mount"
6. restore from the copy
7. Unmount the image: dism /Unmount-Image /MountDir:"C:\WinPE_ISO_START\mount: /commit
8. Create the iso: makewinpemedia /iso "C:\WinPE_ISO_START" "C:\Changed iso.iso"
6
  • 1
  • That talks about creating an ISO, not converting an altered usb drive to an iso.
    – Mark Deven
    Mar 28, 2020 at 18:20
  • This look like an XY problem. Why not do it as documented by Microsoft? As you are modifying critical files the error is obvious. You can modify WinPE by mounting the boot.wim file with dism.
    – Biswapriyo
    Mar 28, 2020 at 19:16
  • Yeah I'm kind of figuring that out. I'm working on a program that allows you to manage winpe drives, and one common feature that has been requested is the ability to save a winpe usb drive to an iso so it can be tested on virtualbox or made into a CD. I don't fully understand WINPE yet so I'm trying to ask as best as I can. If you don't mind bearing with me I think I'll be able to make it less of an XY problem once I figure a bit more out. See the steps update above
    – Mark Deven
    Mar 28, 2020 at 19:35
  • I have another question related to this. Will come back and edit/answer this question once I've figured this out. superuser.com/questions/1537578/… @Biswapriyo
    – Mark Deven
    Mar 31, 2020 at 16:47

1 Answer 1

0
  1. Obtain ISO from VLC with install.wim file instead of install.edf
  2. Mount ISO and copy files into a folder
    (mine is: C:\TempPath\WindowsImages\ExtractedOriginalISO\Windows10)
  3. Mount extracted ISO files to a folder designated for mounting:
Dism /Mount-Image /ImageFile:C:\TempPath\WindowsImages\ExtractedOriginalISO\Windows10\sources\install.wim /Index:5 /MountDir:C:\TempPath\Mount
  1. Open the mounted image in Mount folder and navigate to C:\Windows and create a Panther/Unattend folder, then add the unattend.xml file.
  2. Unmount the image: Dism /Unmount-Image /MountDir:C:\TempPath\Mount /Commit
  3. Create ISO from the folder C:\TempPath\WindowsImages\ExtractedOriginalISO\Windows10:
    Open Deployment Imaging tool as Admin
    Run Command:
oscdimg.exe -m -o -u2 -udfver102 -bootdata:2#p0,e,bC:\TempPath\WindowsImages\ExtractedOriginalISO\Windows10\boot\etfsboot.com#pEF,e,bC:\TempPath\WindowsImages\ExtractedOriginalISO\Windows10\efi\microsoft\boot\efisys.bin C:\TempPath\WindowsImages\ExtractedOriginalISO\Windows10 C:\TempPath\WindowsImages\WindowsLVT.iso

You must log in to answer this question.

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