Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 在长时间的启动/等待命令期间提供进度指示_Windows_Batch File_Cmd_Command Line - Fatal编程技术网

Windows 在长时间的启动/等待命令期间提供进度指示

Windows 在长时间的启动/等待命令期间提供进度指示,windows,batch-file,cmd,command-line,Windows,Batch File,Cmd,Command Line,在批处理文件中,有一个start/wait命令(调用MSI文件的静默安装)。由于此安装可能需要一段时间才能完成,因此我想为最终用户制作动画或显示一些内容,表明批处理文件仍在工作 也许,有没有一种方法可以通过循环代码做到这一点呢?有 如果您正在安装.msi软件包,则可以在安装程序时使用“/被动”选项仅显示进度条。在本例中,我将使用PowerShell命令调用带有-wait参数的“msiexec.exe”: Start-Process msiexec.exe -Wait -ArgumentList

在批处理文件中,有一个
start/wait
命令(调用MSI文件的静默安装)。由于此安装可能需要一段时间才能完成,因此我想为最终用户制作动画或显示一些内容,表明批处理文件仍在工作

也许,有没有一种方法可以通过循环代码做到这一点呢?

如果您正在安装.msi软件包,则可以在安装程序时使用“/被动”选项仅显示进度条。在本例中,我将使用PowerShell命令调用带有-wait参数的“msiexec.exe”:

Start-Process msiexec.exe -Wait -ArgumentList "/i C:\directory\msifile.msi /passive /norestart"
如果要查看所有其他选项,请使用:

msiexec.exe /?

这对我来说是一个很好的解决方案。谢谢