2021-01-29 11:57:12 +01:00
|
|
|
@echo off
|
2023-12-28 15:20:40 +01:00
|
|
|
|
|
|
|
rem set name for media ...
|
|
|
|
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
|
|
|
|
set "YY=%dt:~2,2%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
|
|
|
|
set OSLABEL=W10-%YY%%MM%%DD%
|
|
|
|
|
2021-01-29 11:57:12 +01:00
|
|
|
set OSCDPATH="%ProgramFiles(x86)%\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg"
|
2023-02-17 14:42:37 +01:00
|
|
|
set ISOFILE=%SystemDrive%\temp\%OSLABEL%.iso
|
2021-01-29 11:57:12 +01:00
|
|
|
|
2021-03-18 00:08:40 +01:00
|
|
|
IF %1.==. GOTO USAGE
|
|
|
|
|
2023-01-02 17:15:02 +01:00
|
|
|
echo ================================
|
2023-02-20 10:35:26 +01:00
|
|
|
echo Make ISO file from Media ...
|
2023-01-02 17:15:02 +01:00
|
|
|
echo ================================
|
2021-03-17 00:22:50 +01:00
|
|
|
echo.
|
2021-01-29 11:57:12 +01:00
|
|
|
|
2023-02-20 10:35:26 +01:00
|
|
|
set DRIVE=%1
|
2021-01-29 11:57:12 +01:00
|
|
|
|
2023-02-20 10:35:26 +01:00
|
|
|
if /I %DRIVE% == %SystemDrive% (
|
|
|
|
echo ERROR: cannot use drive %DRIVE% !
|
2021-01-29 11:57:12 +01:00
|
|
|
exit /b
|
|
|
|
)
|
|
|
|
|
2023-02-20 10:35:26 +01:00
|
|
|
echo using drive [ %DRIVE% ] ...
|
2023-07-30 12:23:40 +02:00
|
|
|
echo.
|
2021-01-29 11:57:12 +01:00
|
|
|
|
2023-02-20 10:35:26 +01:00
|
|
|
if NOT EXIST %DRIVE% (
|
|
|
|
echo ERROR: drive %DRIVE% not found!
|
2021-01-29 11:57:12 +01:00
|
|
|
exit /b
|
|
|
|
)
|
|
|
|
|
|
|
|
rem =====
|
|
|
|
rem MAIN
|
|
|
|
rem =====
|
|
|
|
|
2021-03-17 00:22:50 +01:00
|
|
|
del /F %ISOFILE% 2>nul
|
2021-01-29 11:57:12 +01:00
|
|
|
|
|
|
|
if EXIST %ISOFILE% (
|
|
|
|
echo ERROR: cannot delete/create %ISOFILE%!
|
|
|
|
echo HINT: maybe it is mounted by Virtualbox or some other tool?
|
|
|
|
exit /b
|
|
|
|
)
|
|
|
|
|
2023-07-30 12:23:40 +02:00
|
|
|
if NOT EXIST %OSCDPATH%\oscdimg.exe (
|
|
|
|
echo ERROR: cannot find oscdimg.exe!
|
|
|
|
echo HINT: is "Assessment and Deployment Kit (ADK)" installed?
|
|
|
|
exit /b
|
|
|
|
)
|
|
|
|
|
2023-02-20 10:35:26 +01:00
|
|
|
%OSCDPATH%\oscdimg -l%OSLABEL% -m -u2 -b%OSCDPATH%\etfsboot.com %DRIVE%\ %ISOFILE%
|
2021-01-29 11:57:12 +01:00
|
|
|
|
2021-03-17 00:22:50 +01:00
|
|
|
echo.
|
2023-01-02 17:15:02 +01:00
|
|
|
echo ======
|
|
|
|
echo READY.
|
|
|
|
echo ======
|
2021-03-17 00:22:50 +01:00
|
|
|
|
2021-01-29 11:57:12 +01:00
|
|
|
GOTO END
|
|
|
|
|
|
|
|
:USAGE
|
2023-02-20 10:35:26 +01:00
|
|
|
echo "usage: %0 <DRIVE>"
|
2021-01-29 11:57:12 +01:00
|
|
|
|
|
|
|
:END
|
|
|
|
|