(对于同事)
我有两个批处理文件:我们将它们命名为 A.bat
和 B.bat
。
B.bat
运行 msi。 A.bat
调用 B.bat
。
如果我直接运行 B.bat
,它工作正常,但如果我通过 A.bat
运行,我会收到以下错误消息:
msiexec 未被识别为内部或外部命令、可操作程序或批处理文件。
我已经尝试了此处提出的三种解决方案,但没有成功:
- Register/repair Windows Installer Service
- Reregister/reinstall the Windows Installer
- Check/Reregister/reinstall the Windows Installer
只是一个小细节,我使用的是嵌入式 Windows XP...在“普通”XP 上它可以正常工作
最佳答案
为了避免出现错误的 DOS 路径问题,您可以通过内置的 start
命令启动 msiexec
,该命令将在具有干净环境变量的新窗口中执行该命令。
例如:
start msiexec ...
这是一个成熟的示例:
C:\>set PATH=an-invalid-path
C:\>notepad
'notepad' is not recognized as an internal or external command,
operable program or batch file.
C:\>start notepad
关于batch-file - 无法通过两个批处理文件运行 msi,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7157453/