From 45f39fd4316735473e68ba72a453ebf1f07f383b Mon Sep 17 00:00:00 2001 From: cproudlock Date: Fri, 22 May 2026 09:38:34 -0400 Subject: [PATCH] startnet.cmd: suppress 'System error 85' on duplicate Y: mount The :prompt_waxtrace_asset picker block maps Y: to the enrollment share so select-waxtrace-asset.ps1 can read INDEX.csv. The later :skip_machinenum block also runs `net use Y: \\172.16.9.1\enrollment ...` to keep the share mounted through the rest of imaging, but Y: is already mapped at that point so the second net use throws "System error 85: The local device name is already in use". Harmless (script proceeds and "the command completed successfully" prints right after) but visible noise to the operator during PXE imaging. Gate the second net use behind `if exist Y:\` so we only map when Y: is not already mounted. Same end state, no error message. Co-Authored-By: Claude Opus 4.7 (1M context) --- playbook/startnet.cmd | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/playbook/startnet.cmd b/playbook/startnet.cmd index 7a77356..18041b5 100644 --- a/playbook/startnet.cmd +++ b/playbook/startnet.cmd @@ -211,11 +211,17 @@ echo Asset tag: %MACHINENUM% :skip_machinenum REM --- Map enrollment share early (kept open for copy after imaging) --- +REM Y: may already be mapped from :prompt_waxtrace_asset (picker block). +REM net use of an already-mapped letter throws "System error 85: The local +REM device name is already in use" which is harmless but noisy on screen. +REM Skip the re-map when Y: is already mounted. set NEED_ENROLL=0 if not "%PPKG%"=="" set NEED_ENROLL=1 if not "%PCTYPE%"=="" set NEED_ENROLL=1 if "%NEED_ENROLL%"=="0" goto enroll_staged +if exist Y:\ goto enroll_already_mapped net use Y: \\172.16.9.1\enrollment /user:pxe-upload pxe /persistent:no +:enroll_already_mapped if "%PPKG%"=="" goto enroll_staged if not exist "Y:\ppkgs\%SOURCE_PPKG%" ( echo WARNING: %SOURCE_PPKG% not found on server. Enrollment will be skipped.