Show the CMD window with Java

后端 未结 1 1684
天涯浪人
天涯浪人 2021-01-15 00:37

I\'m using this code to launch a .cmd file:

try {
            String line;
            Process p = Runtime.getRuntime().exec(myPath + \"\\\\punchRender.cmd\"         


        
相关标签:
1条回答
  • 2021-01-15 00:50

    Instead of running your path, try actually running cmd.exe but using the build in start command to launch a new command window. You can see the full set of command line arguments by entering the following at a command prompt:

    cmd/?
    start/?
    

    in your case, you probably want to execute something like the command:

    cmd /c start c:\path\to\punchRender.cmd
    
    0 讨论(0)
提交回复
热议问题