From 35c4847f2cd661829b8f6c184a7ced2203cc15ed Mon Sep 17 00:00:00 2001 From: "Michael H.G. Schmidt" Date: Mon, 2 Jan 2023 14:52:03 +0100 Subject: [PATCH] \\.\CDROM1 problem #78 --- 02_ExtractIso.cmd | 5 +++-- 07_PrepareStick.cmd | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/02_ExtractIso.cmd b/02_ExtractIso.cmd index 864e08a..2c93541 100644 --- a/02_ExtractIso.cmd +++ b/02_ExtractIso.cmd @@ -1,6 +1,7 @@ @echo off set T=c:\TEMP set W10=%T%\W10 +set ISODRIVE=Y: IF %1.==. GOTO USAGE @@ -26,10 +27,10 @@ rd /S /Q %W10% 1>nul 2>nul mkdir %W10% 1>nul 2>nul echo mounting disk image (iso) with powershell ... -powershell Mount-DiskImage -ImagePath %ISOFILE% +powershell "$diskImg = Mount-DiskImage -ImagePath %ISOFILE% -NoDriveLetter; $volInfo = $diskImg | Get-Volume; mountvol %ISODRIVE% $volInfo.UniqueId" echo copying files from image to targetpath %W10% ... -robocopy \\.\CDROM0 %W10% /MIR /256 /NFL /NDL /R:100 +robocopy %ISODRIVE%\ %W10% /MIR /256 /NFL /NDL /R:100 echo unmounting disk image (iso) ... powershell Dismount-Diskimage -ImagePath %ISOFILE% diff --git a/07_PrepareStick.cmd b/07_PrepareStick.cmd index bc78c7e..620be09 100644 --- a/07_PrepareStick.cmd +++ b/07_PrepareStick.cmd @@ -1,5 +1,6 @@ @echo off set COPY_IMAGE=null +set ISODRIVE=Y: IF %1.==. GOTO USAGE IF %2.==. GOTO USAGE @@ -37,14 +38,14 @@ echo using drive %USBDRIVE% ... echo using image %ISOFILE% ... echo mounting disk image (iso) with powershell ... -powershell Mount-DiskImage -ImagePath %ISOFILE% +powershell "$diskImg = Mount-DiskImage -ImagePath %ISOFILE% -NoDriveLetter; $volInfo = $diskImg | Get-Volume; mountvol %ISODRIVE% $volInfo.UniqueId" if /I %COPY_IMAGE% == /W ( echo copying ALL files including wim from ISO to targetpath %USBDRIVE% ... - robocopy \\.\CDROM0 %USBDRIVE% /MIR /256 /NFL /NDL /R:10 + robocopy %ISODRIVE%\ %USBDRIVE% /MIR /256 /NFL /NDL /R:10 ) else ( echo copying files from ISO WITHOUT wim to targetpath %USBDRIVE% ... - robocopy \\.\CDROM0 %USBDRIVE% /MIR /256 /NFL /NDL /R:10 /XF *.wim + robocopy %ISODRIVE%\ %USBDRIVE% /MIR /256 /NFL /NDL /R:10 /XF *.wim ) echo unmounting disk image (iso) ...