w10install/wim/export-image.cmd

30 lines
622 B
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:07:37 +01:00
set WIM=%SOURCES%\install
2021-01-10 15:49:37 +01:00
2021-03-28 00:07:37 +01:00
if NOT EXIST %WIM%.esd (
echo.
2021-03-28 00:07:37 +01:00
echo [%0] WARNING: %WIM%.esd NOT found!
2021-03-28 00:03:35 +01:00
rem search for "install.wim" ...
2021-03-28 00:07:37 +01:00
if NOT EXIST %WIM%.wim (
echo [%0] ERROR: %WIM%.wim also NOT found!
2021-03-28 00:03:35 +01:00
exit /b
) else (
rem rename WIM file ...
2021-03-28 00:07:37 +01:00
move /Y %WIM%.wim %WIM%-orig.wim
2021-03-28 00:04:45 +01:00
)
)
2021-03-28 00:03:35 +01:00
echo deleting "old" install.wim ...
2021-03-28 00:07:37 +01:00
del %WIM%.wim 1>nul 2>nul
2021-01-10 15:49:37 +01:00
2021-03-28 00:07:37 +01:00
echo exporting image from %WIM%-orig.wim ...
2021-01-10 15:49:37 +01:00
dism /Export-Image ^
2021-03-28 00:07:37 +01:00
/SourceImageFile: %WIM%-orig.wim ^
/DestinationImageFile:%WIM%.wim ^
2021-01-10 15:49:37 +01:00
/SourceName:"Windows 10 Pro" ^
2021-03-28 00:03:35 +01:00
/Compress:None ^
2021-01-10 15:49:37 +01:00
/CheckIntegrity