2021-03-14 19:39:32 +01:00
|
|
|
@echo off
|
|
|
|
|
2021-03-18 00:08:40 +01:00
|
|
|
IF %1.==. GOTO USAGE
|
|
|
|
IF %2.==. GOTO USAGE
|
|
|
|
|
2021-03-17 00:22:50 +01:00
|
|
|
echo.
|
|
|
|
echo ====================
|
|
|
|
echo Create USB Stick ...
|
|
|
|
echo ====================
|
2021-03-14 19:39:32 +01:00
|
|
|
|
|
|
|
rem get fullpath of isofile ...
|
|
|
|
set USBDRIVE=%1
|
|
|
|
set ISOFILE=%~f2
|
|
|
|
|
|
|
|
if NOT EXIST %ISOFILE% (
|
|
|
|
echo ERROR: file %ISOFILE% not found!
|
|
|
|
exit /b
|
|
|
|
)
|
|
|
|
|
|
|
|
if /I %USBDRIVE% == C: (
|
|
|
|
echo ERROR: cannot use drive %USBDRIVE% !
|
|
|
|
exit /b
|
|
|
|
)
|
|
|
|
|
|
|
|
if NOT EXIST %USBDRIVE% (
|
|
|
|
echo ERROR: drive %USBDRIVE% not found!
|
|
|
|
exit /b
|
|
|
|
)
|
|
|
|
|
|
|
|
rem =====
|
|
|
|
rem MAIN
|
|
|
|
rem =====
|
|
|
|
|
|
|
|
echo using drive %USBDRIVE% ...
|
|
|
|
echo using image %ISOFILE% ...
|
|
|
|
|
|
|
|
echo mounting disk image (iso) with powershell ...
|
|
|
|
powershell Mount-DiskImage -ImagePath %ISOFILE%
|
|
|
|
|
|
|
|
echo copying files from image to targetpath %USBDRIVE% ...
|
2021-03-27 12:55:58 +01:00
|
|
|
robocopy \\.\CDROM0 %USBDRIVE% /MIR /256 /NFL /NDL /R:10
|
2021-03-14 19:39:32 +01:00
|
|
|
|
|
|
|
echo unmounting disk image (iso) ...
|
|
|
|
powershell Dismount-Diskimage -ImagePath %ISOFILE%
|
|
|
|
|
|
|
|
echo READY.
|
|
|
|
echo.
|
|
|
|
|
|
|
|
rem =====
|
|
|
|
rem END
|
|
|
|
rem =====
|
|
|
|
GOTO END
|
|
|
|
|
|
|
|
:USAGE
|
|
|
|
echo "usage: %0 <USBDRIVE> <ISOFILE>"
|
|
|
|
|
|
|
|
:END
|
|
|
|
|