w10install/wim/export-image.cmd

65 lines
1.0 KiB
Batchfile
Raw Normal View History

2021-01-10 15:49:37 +01:00
@echo off
set SOURCES=c:\TEMP\W10\sources
2021-03-28 00:10:18 +01:00
set ESD=%SOURCES%\install.esd
set WIM=%SOURCES%\install.wim
2021-03-28 00:29:33 +01:00
set W10PRO=%SOURCES%\w10pro.wim
set STATEFILE=%SOURCES%\w10pro.txt
if EXIST %ESD% (
echo.
echo INFO: found %ESD%
echo deleting "old" install.wim ...
del %WIM% 1>nul 2>nul
echo exporting image from %ESD% ...
dism /Export-Image ^
/SourceImageFile:%ESD% ^
/DestinationImageFile:%WIM% ^
/SourceName:"Windows 10 Pro" ^
2021-03-28 00:32:53 +01:00
/Compress:Max ^
2021-03-28 00:29:33 +01:00
/CheckIntegrity
echo.
echo READY.
exit /b
)
if EXIST %WIM% (
echo.
echo INFO: found %WIM%
echo exporting image from %WIM% ...
dism /Export-Image ^
/SourceImageFile:%WIM% ^
/DestinationImageFile:%W10PRO% ^
/SourceName:"Windows 10 Pro" ^
2021-03-28 00:32:53 +01:00
/Compress:Max ^
2021-03-28 00:29:33 +01:00
/CheckIntegrity
move /Y %W10PRO% %WIM%
echo all done >%STATEFILE%
2021-01-10 15:49:37 +01:00
echo.
2021-03-28 00:29:33 +01:00
echo READY.
exit /b
)
2021-03-28 00:29:33 +01:00
if EXIST %STATEFILE% (
echo.
echo INFO: found %STATEFILE%
echo nothing todo. all work was already done.
echo READY.
exit /b
)
2021-01-10 15:49:37 +01:00
2021-03-28 00:29:33 +01:00
set ERRORLEVEL=9009
2021-01-10 15:49:37 +01:00