开发者

Running the program with out GUI

开发者 https://www.devze.com 2023-02-23 03:39 出处:网络
I have a requirement in my project that I have to run external program with out GUI even if external program has GUI(like notepad.exe).This is possible in .NET. But my program is in java. I found out

I have a requirement in my project that I have to run external program with out GUI even if external program has GUI(like notepad.exe).This is possible in .NET. But my program is in java. I found out that java does not have t开发者_运维问答his facility.

Please let me know is there any program like hstart(which only hides the console not GUI) which hides the GUI if program is given as parameter(Ex: [hstart] notepad.exe).


If you know how to do that in .NET write a little program for this yourself and call it from your java app.


Same idea as previous answer, but you can call through a vbs script. For example, you have "run_and_hide.vbs"


Set WshShell = WScript.CreateObject("WScript.Shell")
Return=WshShell.Run(Wscript.Arguments(0),0,false)

Then execute the script from java code and pass the target program in the first argument:


Runtime.getRuntime().exec("cmd /c start run_and_hide.vbs " + "\"notepad\"");
0

精彩评论

暂无评论...
验证码 换一张
取 消