在远端电脑上在 Powershell 中直接运行 .msi 文件,报了一个 Cannot run a document in the middle of a pipeline 错误,调用 msiexec.exe 来安装 .msi 又报了一个 This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package.
Cannot run a document in the middle of a pipeline: path\to\rewrite.msi- msiexec.exe /package .\rewrite.msi /passive
复制代码 This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package.
经过一翻研究发现把相对路径换成绝对路径或者去掉.\可以解决问题,也就是按下面这两种方式调用 msiexec.exe 安装 .msi 文件。- msiexec.exe /package C:\Users\Wuxiancheng\Downloads\rewrite.msi /passive
复制代码- msiexec.exe /package rewrite.msi /passive
复制代码 参考链接:msiexec |