WinPE Windows 10 Imaging -- Unable to call 'wpeutil reboot' after 'PAUSE' in BATCH script

Jon Love :

I'm using WinPE to lay down my Windows 10 image using DISM and copying my install files into place for first boot. I had no issue using the script and calling 'wpeutil reboot' command at the end of the script, but the problem is that this PC uses a UEFI boot and once the USB drive is selected from the boot menu, it will just loop and start WinPE and go through the process over and over unless someone removes the USB drive after my script completes.

I decided to Echo to the USER to remove the USB drive, call a PAUSE, and then call 'wpeutil reboot' command, but the problem is that when 'PAUSE' is included, I get an error that it cannot find the path specified (see linked photo). If I remove the PAUSE, it works as expected.

Any help would be appreciated.

@echo Find a drive that has a folder titled Images.
@for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do @if exist %%a:\Deploy\ set IMAGESDRIVE=%%a
@echo The DEPLOY folder is on drive: %IMAGESDRIVE%
@dir %IMAGESDRIVE%:\Deploy /w

diskpart /s %IMAGESDRIVE%:\Deploy\Scripts\CreatePartitions-UEFI.txt

Dism /apply-image /imagefile:%IMAGESDRIVE%:\Deploy\Image\DE6340.swm /swmfile:%IMAGESDRIVE%:\Deploy\Image\DE6340*.swm /index:1 /applydir:w:\

W:\Windows\System32\bcdboot W:\Windows /s S:

md w:\TEMP

xcopy /s %IMAGESDRIVE%:\Deploy\Apps\Temp W:\TEMP

xcopy /s %IMAGESDRIVE%:\Deploy\Scripts\Temp.vbs "W:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup"

cls

@ECHO OFF

ECHO ******************************************
ECHO *********** STEP 1 - COMPLETE ************
ECHO ******************************************

ping 1.1.2.2 -n 1 -w 1000 > nul

ECHO.
ECHO **********************************************
ECHO *** REMOVE THE USB DRIVE BEFORE CONTINUING ***
ECHO **********************************************
ECHO.

ping 1.1.2.2 -n 1 -w 2000 > nul

PAUSE

wpeutil.exe reboot

Error Returned when including PAUSE

Josh :

You could try creating a batch file with just the echos/pause/reboot and put that on the USB drive. Then, in the original script, after the xcopys, copy that echo/pause/reboot batch to the W:, and execute it with the original script.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=382869&siteId=1