w10install/07_MakeISOfromStick.cmd

53 lines
996 B
Batchfile
Raw Normal View History

2021-01-29 11:57:12 +01:00
@echo off
set OSCDPATH="%ProgramFiles(x86)%\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg"
set OSLABEL=WIN10-AUTO
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 ================================
echo Make ISO file from USB stick...
echo ================================
2021-03-17 00:22:50 +01:00
echo.
2021-01-29 11:57:12 +01:00
set USBDRIVE=%1
2023-02-17 14:42:37 +01:00
if /I %USBDRIVE% == %SystemDrive% (
2021-01-29 11:57:12 +01:00
echo ERROR: cannot use drive %USBDRIVE% !
exit /b
)
2021-03-17 00:22:50 +01:00
echo using drive [ %USBDRIVE% ] ...
2021-01-29 11:57:12 +01:00
if NOT EXIST %USBDRIVE% (
echo ERROR: drive %USBDRIVE% not found!
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
)
2021-03-28 19:53:17 +02:00
%OSCDPATH%\oscdimg -l%OSLABEL% -m -u2 -b%OSCDPATH%\etfsboot.com %USBDRIVE%\ %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
echo "usage: %0 <USBDRIVE>"
:END