怎么在java里打开bat文件

怎么在java里打开bat文件,第1张

public class MyTest {

public static void mm(){

Runtime run= Runtime.getRuntime()

try

{

run.exec("D:/abc.bat")//添加程序路径

}catch(Exception e)

{

e.printStackTrace()

}

}

public static void main(String[] args) throws IOException {

Desktop.getDesktop().open(new File("d:/abc.bat"))

}

}

}

public class MyTest {

public static void mm(){

Runtime run= Runtime.getRuntime()

try

{

run.exec("D:/abc.bat")//添加程序路径

}catch(Exception e)

{

e.printStackTrace()

}

}

public static void main(String[] args) throws IOException {

Desktop.getDesktop().open(new File("d:/abc.bat"))

}

}

}


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/tougao/11691653.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-18
下一篇 2023-05-18

发表评论

登录后才能评论

评论列表(0条)

保存