如何在不隐藏控制台窗口的情况下运行批处理文件? [英] How to run a batch file keeping the console window hidden?
问题描述
我想在安装完成后启动成功安装的Java程序.我原则上知道该怎么做:
I want to start my successfully installed Java program after the installation finished. I know how to do it in principle:
[Run]
FileName: "{app}\LaunchApp.bat"; Description: {cm:LaunchApp}; Flags: nowait postinstall skipifsilent
LaunchApp.bat:
LaunchApp.bat:
start javaw -jar MyJar.jar Main
这样,控制台窗口会弹出一会儿,这不是很好.使用链接可以避免这种情况.但是,我似乎无法执行在[Run]
部分的[Icon]
中创建的链接.
This way, the console window pops up for a short while, which is not very nice. Using links, this can be avoided. However, I don't seem to be able to execute a link created in the [Icon]
in the [Run]
section.
任何建议如何解决这个问题?
Any suggestions how to solve this?
推荐答案
尝试添加 runhidden
标志.根据参考资料:
Try to add the runhidden
flag. From the reference:
如果指定此标志,它将在隐藏状态下启动程序 窗户.在执行可能提示的程序时,切勿使用此标志 供用户输入.
If this flag is specified, it will launch the program in a hidden window. Never use this flag when executing a program that may prompt for user input.
因此,这应该可以解决您的问题:
So this should resolve your question:
[Run]
FileName: "{app}\LaunchApp.bat"; Description: {cm:LaunchApp}; Flags: nowait postinstall runhidden skipifsilent
这篇关于如何在不隐藏控制台窗口的情况下运行批处理文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!