2020-12-25 20:08:46 +01:00
|
|
|
@echo off
|
2021-01-10 15:49:37 +01:00
|
|
|
set SOURCES=c:\TEMP\W10\sources
|
2021-03-14 19:39:32 +01:00
|
|
|
set IMAGE=install_FINAL.esd
|
|
|
|
set ALTIMAGE=install_FINAL_lastrun.esd
|
2020-12-25 20:08:46 +01:00
|
|
|
|
2021-01-10 15:49:37 +01:00
|
|
|
rem ===================
|
|
|
|
rem COMMANDLINE CHECKS
|
|
|
|
rem ===================
|
2020-12-25 20:08:46 +01:00
|
|
|
|
2021-01-10 15:49:37 +01:00
|
|
|
IF %1.==. GOTO USAGE
|
2021-03-14 19:39:32 +01:00
|
|
|
|
2021-01-10 15:49:37 +01:00
|
|
|
set USBDRIVE=%1
|
2021-01-10 00:22:42 +01:00
|
|
|
|
2021-01-10 15:49:37 +01:00
|
|
|
if /I %USBDRIVE% == C: (
|
|
|
|
echo ERROR: cannot use drive %USBDRIVE% !
|
|
|
|
exit /b
|
|
|
|
)
|
|
|
|
|
|
|
|
if NOT EXIST %USBDRIVE% (
|
|
|
|
echo ERROR: drive %USBDRIVE% not found!
|
2021-01-10 00:22:42 +01:00
|
|
|
exit /b
|
|
|
|
)
|
|
|
|
|
2021-03-14 19:39:32 +01:00
|
|
|
echo.
|
|
|
|
echo ##########################################
|
|
|
|
echo using drive %USBDRIVE% ...
|
|
|
|
|
2021-01-29 11:57:12 +01:00
|
|
|
rem =====
|
|
|
|
rem MAIN
|
|
|
|
rem =====
|
|
|
|
|
2021-01-12 19:22:13 +01:00
|
|
|
set answer=
|
2021-01-10 00:22:42 +01:00
|
|
|
:ask
|
|
|
|
set /p answer="BIOS or UEFI setup (B/U)? "
|
|
|
|
if /i "%answer:~,1%" EQU "B" (
|
2021-01-12 19:22:13 +01:00
|
|
|
echo selected: BIOS
|
2021-01-10 15:49:37 +01:00
|
|
|
copy /Y autounattend_BIOS.xml %USBDRIVE%\autounattend.xml
|
2021-03-14 19:39:32 +01:00
|
|
|
GOTO CONT
|
2021-01-10 00:22:42 +01:00
|
|
|
)
|
|
|
|
if /i "%answer:~,1%" EQU "U" (
|
2021-01-12 19:22:13 +01:00
|
|
|
echo selected: UEFI
|
2021-01-10 15:49:37 +01:00
|
|
|
copy /Y autounattend_UEFI.xml %USBDRIVE%\autounattend.xml
|
2021-03-14 19:39:32 +01:00
|
|
|
GOTO CONT
|
2021-01-10 00:22:42 +01:00
|
|
|
)
|
|
|
|
echo Please type B for BIOS or U for UEFI setup.
|
|
|
|
goto ask
|
2021-01-10 15:49:37 +01:00
|
|
|
:CONT
|
2021-01-10 00:22:42 +01:00
|
|
|
|
2021-03-14 19:39:32 +01:00
|
|
|
if EXIST %SOURCES%\%IMAGE% (
|
|
|
|
|
|
|
|
echo.
|
|
|
|
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.
|
|
|
|
|
2020-12-25 20:08:46 +01:00
|
|
|
)
|
|
|
|
|
2021-03-14 19:39:32 +01:00
|
|
|
:CONT
|
2021-01-12 17:01:34 +01:00
|
|
|
echo.
|
|
|
|
if EXIST tools (
|
|
|
|
echo copying folder tools to drive %USBDRIVE% ...
|
2021-01-12 19:22:13 +01:00
|
|
|
robocopy tools %USBDRIVE%\tools /COPY:DT /FFT /XO /256 /NJH /NJS /NDL /XF .gitignore
|
2021-01-12 17:01:34 +01:00
|
|
|
)
|
|
|
|
|
2021-03-13 23:32:05 +01:00
|
|
|
for %%P in (software scripts source optional personal) do (
|
2021-01-10 15:49:37 +01:00
|
|
|
if EXIST %%P (
|
2021-01-10 23:14:52 +01:00
|
|
|
echo.
|
2021-01-12 17:01:34 +01:00
|
|
|
echo copying folder %%P to drive %USBDRIVE%\tools ...
|
2021-03-14 00:34:27 +01:00
|
|
|
robocopy %%P %USBDRIVE%\tools\%%P /COPY:DT /FFT /XO /MIR /256 /NJH /NJS /NDL /XF .gitignore /XD .git
|
2021-01-10 15:49:37 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2021-01-10 23:14:52 +01:00
|
|
|
echo.
|
2021-01-10 15:49:37 +01:00
|
|
|
echo copying custom setup script to %USBDRIVE% ...
|
|
|
|
copy /Y CustomSetup.cmd %USBDRIVE%\
|
2021-03-14 19:39:32 +01:00
|
|
|
echo READY.
|
|
|
|
echo.
|
2021-01-10 15:49:37 +01:00
|
|
|
|
|
|
|
rem =====
|
|
|
|
rem END
|
|
|
|
rem =====
|
|
|
|
GOTO END
|
|
|
|
|
|
|
|
:USAGE
|
|
|
|
echo "usage: %0 <USBDRIVE>"
|
2021-02-24 22:26:55 +01:00
|
|
|
echo.
|
2021-01-10 15:49:37 +01:00
|
|
|
|
|
|
|
:END
|
|
|
|
|