简体   繁体   中英

Java Desktop API, Launch .cmd file

I want to use the Desktop API to lauch .cmd file on Windows.

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

But this launches the .cmd file as if it were called from the current directory. So it isn't the same as double-clicking the .cmd file.

Any ideas how to call the file as if we were in the directory?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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