如何通过批处理文件传递用于自动安装.msi文件的参数 [英] How to pass the parameters for automatic installation of .msi file with batch file
问题描述
我正在通过在批处理文件中使用
I am using the installation of .msi file by using
msiexec /i D:\Download\7z920.msi /qn
来安装.msi文件.
但是我需要替换这些值,并且在进行安装时需要从下拉列表中选择值.请帮我. URGENT
in batch file.
But I need to replace the values and I need to select the value from drop-down when Installation is happening. Please Help me. URGENT
推荐答案
请参阅我的评论.无论如何,您是否只想知道参数如何与批处理文件一起使用?
假设您要抽象出"/i"、D:\Download\7z920.ms"和"qn".在这种情况下,您可以拥有批处理文件myBatch.bat
Please see my comment. Anyway, do you just want to know how parameters work with batch files?
Suppose you want to abstract out "/i", "D:\Download\7z920.ms" and "qn". In this case you could have the batch filemyBatch.bat
msiexec %1 %2 %3
并将其执行为
myBatch.bat /i D:\Download\7z920.msi /qn
显然,它不会带来太多好处.如果将相同的参数硬编码在批处理文件中,并且将某些参数传递给批处理调用者,则我会有所帮助:
Apparently, it won''t get much benefits. I helps if same parameters are hard-coded in batch file and some are passed to the batch caller:
msiexec /i %1 /qn
并将其执行为
myBatch.bat D:\Download\7z920.msi
隐藏很少更改的细节.
同样,如果其他东西(另一个批处理文件)多次执行/启动具有不同参数的批处理文件(例如在循环中),也会很有帮助.
to hide rarely changed detail.
Also, it helps if something else (another batch file) executes/starts your batch file with different parameters several time, for example, in a loop.
这篇关于如何通过批处理文件传递用于自动安装.msi文件的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!