startnet.cmd: robocopy /XD instead of xcopy /EXCLUDE:NUL for waxtrace stage

WJF00159 imaging pass on 2026-05-24 logged:
  [ERROR] waxtrace-manifest.json not found at
          C:\WaxTrace-Install\waxtrace-manifest.json
even though the manifest is present on the PXE share. Root cause: the
xcopy approach copied EVERYTHING including the 12+ GB formtracepak\
directory of vendor ISOs, then deleted formtracepak\ afterward and
re-created it with just the one matched ISO. The /EXCLUDE:NUL placeholder
("pass NUL device as exclude-file") was silently ignored by xcopy in
WinPE, and the redirection >/dev/null 2>/dev/null hid any errors. The copy was
either aborting mid-stream (running out of patience / disk / connection)
or the manifest landed but got clobbered in the rmdir/recreate dance.

Switch to robocopy /XD formtracepak which excludes the dir up front so
we never even attempt the 12 GB of ISOs. Keep /NFL /NDL to suppress
per-file listing but leave overall output visible (no >/dev/null) so any
failure is debuggable from the install log. Check errorlevel >= 8
explicitly (robocopy exit codes 0-7 are all "OK").

Smoke tested on win11 VM with a representative tree (manifest +
bay-config + backups\WJF00159.zip + prereqs\hasp.exe + dummy
formtracepak\ ISOs): formtracepak\ excluded, all other files +
sub-dirs copied cleanly, exit 1 (= OK).

Pushed to boot.wim.with-ps (the correct PowerShell-bearing wim - the
one I had been editing before was missing powershell.exe) and deployed
to /var/www/html/win11/sources/boot.wim on 172.16.9.1.
This commit is contained in:
cproudlock
2026-05-24 14:07:45 -04:00
parent 77c917157d
commit 8e1f81b942

View File

@@ -493,11 +493,14 @@ REM (so 09-Setup-WaxAndTrace.ps1 mounts the right version per bay)
if /i not "%PCTYPE%"=="gea-shopfloor-waxtrace" goto skip_waxtrace_stage if /i not "%PCTYPE%"=="gea-shopfloor-waxtrace" goto skip_waxtrace_stage
if not exist "Y:\installers-post\waxtrace\waxtrace-manifest.json" goto skip_waxtrace_missing if not exist "Y:\installers-post\waxtrace\waxtrace-manifest.json" goto skip_waxtrace_missing
mkdir W:\WaxTrace-Install 2>NUL mkdir W:\WaxTrace-Install 2>NUL
REM xcopy everything except the formtracepak\ dir (we cherry-pick one ISO below). REM robocopy /XD excludes the formtracepak\ dir up front so we don't waste
xcopy /E /Y /I /EXCLUDE:NUL "Y:\installers-post\waxtrace" "W:\WaxTrace-Install\" >NUL 2>NUL REM disk + time copying 12+ GB of vendor ISOs only to delete them. The
REM (Exclude file via /EXCLUDE expects a file; simpler to xcopy the whole tree REM matched FTPak ISO gets cherry-picked below into the same target dir.
REM then delete the formtracepak\ subdir + re-create with just the matched ISO.) REM /NFL/NDL keep the listing manageable; output left visible (no >NUL) so
if exist "W:\WaxTrace-Install\formtracepak" rmdir /S /Q "W:\WaxTrace-Install\formtracepak" REM any failure is debuggable from the install log. robocopy exit codes
REM 0-7 are "OK" (per Microsoft); 8+ is real failure.
robocopy "Y:\installers-post\waxtrace" "W:\WaxTrace-Install" /E /XD formtracepak /R:1 /W:1 /NFL /NDL
if errorlevel 8 echo WARNING: robocopy exit %ERRORLEVEL% - some files may not have copied.
mkdir W:\WaxTrace-Install\formtracepak 2>NUL mkdir W:\WaxTrace-Install\formtracepak 2>NUL
echo Staged WaxTrace bootstrap minus formtracepak\ to W:\WaxTrace-Install. echo Staged WaxTrace bootstrap minus formtracepak\ to W:\WaxTrace-Install.
REM Resolve bay-config: writes W:\Enrollment\waxtrace\{version,model,userid}.txt REM Resolve bay-config: writes W:\Enrollment\waxtrace\{version,model,userid}.txt