@echo off rem Build the PXE server installer USB. Double-click this file in the build rem folder (copied to a local disk, e.g. C:\pxe-usb). It asks for admin rem rights, lists the USB disks and asks which one to erase and build. rem Runs scripts\Build-PxeUsb.ps1 -Interactive with the execution policy rem bypassed for that one window only. setlocal set "PS1=%~dp0scripts\Build-PxeUsb.ps1" if not exist "%PS1%" ( echo Cannot find %PS1% echo Run this from the pxe-usb build folder. pause exit /b 1 ) if "%~d0"=="\\" goto :network net use %~d0 >nul 2>&1 && goto :network powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process powershell -Verb RunAs -ArgumentList '-NoProfile','-ExecutionPolicy','Bypass','-File','\"%PS1%\"','-Interactive'" exit /b 0 :network echo This build folder is on a network drive (%~d0). echo An administrator window cannot see network drives mapped in this session. echo Copy the whole pxe-usb folder to a local disk first, for example: echo. echo robocopy "%~dp0." C:\pxe-usb /E echo. echo then double-click C:\pxe-usb\Build-PxeUsb.cmd pause exit /b 1