静默安装Windows 7时startnet.cmd出现问题

静默安装Windows 7时startnet.cmd出现问题,windows,Windows,我正在尝试使用startnet.cmd文件无人值守地启动windows 7。问题是,当启动setup.exe命令被触发时,安装程序运行并关闭,但无法重新启动,因为startnet.cmd仍处于打开状态。如果我输入“退出”,它将启动设置并立即退出。是否有方法检查安装程序是否成功运行,然后执行退出 wpeinit net use u: \\192.168.2.10\windows u: start setup.exe /unattend:\\192.168.2.10\windows\unattend

我正在尝试使用startnet.cmd文件无人值守地启动windows 7。问题是,当启动setup.exe命令被触发时,安装程序运行并关闭,但无法重新启动,因为startnet.cmd仍处于打开状态。如果我输入“退出”,它将启动设置并立即退出。是否有方法检查安装程序是否成功运行,然后执行退出

wpeinit
net use u: \\192.168.2.10\windows
u:
start setup.exe /unattend:\\192.168.2.10\windows\unattend.xml /noreboot
REM ping -n 30 127.0.0.1
REM exit

我认为您的命令是正确的,但您明确指出,
setup.exe
在安装过程的第一阶段完成后不应启动重新启动

在安装过程中,黑色的
cmd.exe
窗口必须保持打开状态。如果终止,Windows PE将立即重新启动。因此,setup.exe进程将终止。我认为您使用ping延迟退出的评论很好地表明您试图延迟终止shell进程。但由于您不知道设置过程需要多长时间,因此无法在延迟算法中填充任何好的值

虽然我认为你不需要。您正在使用
start
启动
setup.exe
,它将分离进程并立即返回shell。事实上,由于setup.exe是您运行的最后一个命令,您也可以接受setup.exe未分离的事实。不使用
start
或使用
start/wait

wpeinit
net use u: \\192.168.2.10\windows
u:
setup.exe /unattend:\\192.168.2.10\windows\unattend.xml /noreboot
exit

尽管我认为这样做的全部目的是在
setup.exe
终止后返回shell并执行
exit
(启动重新启动)命令

由于没有更多的命令要执行,我建议通过删除
/noreboot
标志,让
setup.exe
自行重新启动:

wpeinit
net use u: \\192.168.2.10\windows
u:
start setup.exe /unattend:\\192.168.2.10\windows\unattend.xml
这将使shell进程(
cmd.exe
)在安装程序运行时保持打开状态。在安装过程结束时,它将启动重新启动(由
setup.exe
启动),因此也会重新启动

wpeinit
net use u: \\192.168.2.10\windows
u:
start setup.exe /unattend:\\192.168.2.10\windows\unattend.xml