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



我正在尝试使用startnet.cmd文件以无人参与的方式启动windows 7。问题是,当启动setup.exe命令被触发时,安装程序会运行并关闭,但由于startnet.cmd仍处于打开状态,因此无法重新启动。如果我输入"退出",它将启动设置并立即退出。有没有一种方法可以检查安装是否成功运行,然后执行退出?

wpeinit
net use u: \192.168.2.10windows
u:
start setup.exe /unattend:\192.168.2.10windowsunattend.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.10windows
u:
setup.exe /unattend:\192.168.2.10windowsunattend.xml /noreboot
exit

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

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

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

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

这将在安装程序运行时保持shell进程(cmd.exe(处于打开状态。在设置过程结束时,它将启动重新启动(由setup.exe启动(,因此也会启动

最新更新