简体   繁体   English

WinPE Windows 10 成像——无法在批处理脚本中的“暂停”后调用“wpeutil 重启”

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

I'm using WinPE to lay down my Windows 10 image using DISM and copying my install files into place for first boot.我正在使用 WinPE 使用 DISM 放置我的 Windows 10 映像并将我的安装文件复制到位以进行首次启动。 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.我使用脚本并在脚本末尾调用“wpeutil reboot”命令没有问题,但问题是这台 PC 使用 UEFI 启动,一旦从启动菜单中选择了 USB 驱动器,它就会循环并启动WinPE 并一遍又一遍地执行该过程,除非有人在我的脚本完成后移除了 USB 驱动器。

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).我决定回显给用户以移除 USB 驱动器,调用 PAUSE,然后调用 'wpeutil reboot' 命令,但问题是当包含 'PAUSE' 时,我收到一个错误,提示它找不到指定的路径(见链接照片)。 If I remove the PAUSE, it works as expected.如果我删除 PAUSE,它会按预期工作。

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包含 PAUSE 时返回错误

You could try creating a batch file with just the echos/pause/reboot and put that on the USB drive.您可以尝试仅使用 echos/pause/reboot 创建一个批处理文件并将其放在 USB 驱动器上。 Then, in the original script, after the xcopys, copy that echo/pause/reboot batch to the W:, and execute it with the original script.然后,在原始脚本中,在 xcopys 之后,将该 echo/pause/reboot 批处理复制到 W:,并使用原始脚本执行它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM