简体   繁体   English

Java Desktop API,启动.cmd文件

[英]Java Desktop API, Launch .cmd file

I want to use the Desktop API to lauch .cmd file on Windows. 我想在Windows上使用Desktop API来创建.cmd文件。

Desktop.getDesktop().open(new File(config.getCommandFilePath()));

But this launches the .cmd file as if it were called from the current directory. 但是这会启动.cmd文件,就像从当前目录中调用它一样。 So it isn't the same as double-clicking the .cmd file. 所以它与双击.cmd文件不同。

Any ideas how to call the file as if we were in the directory? 任何想法如何调用该文件,就像我们在目录中一样?

看到这个答案,它可以提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM