This commit is contained in:
Michael H.G. Schmidt 2021-03-31 10:28:39 +02:00
parent cd55ca11eb
commit 6b5ff9e156
2 changed files with 11 additions and 20 deletions

View File

@ -1,8 +1,7 @@
@echo off
set SOURCES=c:\TEMP\W10\sources
set BOOT=boot.wim
set IMAGE=install_FINAL.esd
set ALTIMAGE=install_FINAL_lastrun.esd
set IMAGE=install.esd
IF %1.==. GOTO USAGE
@ -87,22 +86,11 @@ if EXIST %SOURCES%\%IMAGE% (
echo copying [ %IMAGE% ] to drive %USBDRIVE% ...
robocopy %SOURCES% %USBDRIVE%\sources %IMAGE% /J /NJH
rem move image in place ...
del /F %USBDRIVE%\sources\install.esd 2>nul
move /Y %USBDRIVE%\sources\%IMAGE% %USBDRIVE%\sources\install.esd
rem rename image in sources directory ...
move /Y %SOURCES%\%IMAGE% %SOURCES%\%ALTIMAGE%
) else (
echo.
echo INFO: NOT copying image!
echo.
echo HINT: please rename
echo [ %SOURCES%\%ALTIMAGE% ]
echo to [ %SOURCES%\%IMAGE% ]
echo for force copy of image.
rem echo.
echo DOH! no %IMAGE% in [ %SOURCES ] found
exit /b
)

View File

@ -1,9 +1,9 @@
@echo off
set SOURCES=c:\TEMP\W10\sources
set IMAGE=c:\TEMP\IMAGE
set SOURCES=c:\TEMP\W10\sources
set ESD=%SOURCES%\install.esd
set WIM=%SOURCES%\install.wim
set FINAL=%SOURCES%\install_FINAL.esd
set TEMPFILE=%SOURCES%\temp.esd
if NOT EXIST %WIM% (
echo.
@ -34,14 +34,17 @@ dism /Unmount-Wim /MountDir:%IMAGE% /Commit
echo [%0] INFO: directory of %IMAGE% :
dir %IMAGE%
echo [%0] INFO: exporting %WIM% to %FINAL% ...
echo [%0] INFO: exporting %WIM% to %TEMPFILE% ...
dism /Export-Image ^
/SourceImageFile:%WIM% ^
/DestinationImageFile:%FINAL% ^
/DestinationImageFile:%TEMPFILE% ^
/SourceName:"Windows 10 Pro" ^
/Compress:Recovery ^
/CheckIntegrity
echo [%0] INFO: renaming new esd file to %ESD% ...
move /Y %TEMPFILE% %ESD%
rem delete wim file only in case there is an esd file ...
if EXIST %ESD% (
echo [%0] INFO: deleting %WIM%