Want to hide command prompt window in using WshShell.Exec method

后端 未结 1 1733
粉色の甜心
粉色の甜心 2021-01-19 00:45

I want to execute a java program from a javascript and want to get the output.

Intailly i tried with below code:

WshShell = new ActiveXObject(\"WScri         


        
相关标签:
1条回答
  • Yes, that bother all wsh scripters. No way to hide wshExec object, only .Run allow this option, but no StdOut in this case. Shortly, the only way is to redirect your output to file.

    WshShell   = new ActiveXObject("WScript.Shell");
    var launch ="cmd.exe /c java -classpath . HelloWorld > output.txt";
    var cmdRun = WshShell.Run(launch,0,true);
    
    0 讨论(0)
提交回复
热议问题