Advertisement
paroxy

dump-wim.cmd

Dec 19th, 2020 (edited)
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.34 KB | None | 0 0
  1. @ECHO OFF
  2. IF [%1] EQU [] (goto showHelp)
  3. SET esdFile=%1
  4. IF "%esdFile%"=="/h" (goto showHelp)
  5. IF "%esdFile%"=="/?" (goto showHelp)
  6. IF NOT EXIST "%esdFile%" (GOTO fileNotFound) ELSE (GOTO runGetWim)
  7.  
  8. :runGetWim
  9. echo dism /Get-WimInfo /WimFile:%esdFile%
  10. dism /Get-WimInfo /WimFile:%esdFile%
  11.  
  12. echo Enter an index # to export a WIM file, or press ENTER to quit.
  13. set /p wimIndex=Index Number:
  14. if "%wimIndex%"=="" (GOTO exit)
  15. echo Enter a filename for the exported WIM file. (Default=EXPORTED-INSTALL.WIM).
  16. set /p wimFile=Save WIM file as:
  17. IF "%wimFile%"=="" (SET wimFile=EXPORTED-INSTALL.WIM) ELSE GOTO :runExportWIM
  18.  
  19. :runExportWim
  20. echo dism /export-image /SourceImageFile:%esdFile% /SourceIndex:%wimIndex% /DestinationImageFile:%wimFile% /Compress:max /CheckIntegrity
  21. dism /export-image /SourceImageFile:%esdFile% /SourceIndex:%wimIndex% /DestinationImageFile:%wimFile% /Compress:max /CheckIntegrity
  22. GOTO exit
  23.  
  24. :fileNotFound
  25. echo =========================================================
  26. echo ERROR: ESD file %esdFile% not found!
  27.  
  28. :showHelp
  29. echo =========================================================
  30. echo DUMP-WIM.cmd
  31. echo USAGE: dump-wim.cmd [Source_File.ESD]
  32. echo EXAMPLE: dump-wim.cmd INSTALL.ESD
  33. echo =========================================================
  34. GOTO exit
  35.  
  36. :exit
  37. SET "esdFile="
  38. SET "wimIndex="
  39. SET "wimFile="
  40. exit /b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement