博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
java中运行系统命令
阅读量:6860 次
发布时间:2019-06-26

本文共 397 字,大约阅读时间需要 1 分钟。

hot3.png

ProcessBuilder pb = new ProcessBuilder("cmd", "/c", "dir", "c:");            Process p = pb.start();            BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream(), "gbk"));            String line;

和其他系统命令不一样,“dir” is built-in to the windows shell (cmd.exe) and can't be run as a simple executable
“ipconfig /all”命令就可以直接运行

转载于:https://my.oschina.net/u/150309/blog/50344

你可能感兴趣的文章
图片水印
查看>>
Quart2D的基本介绍
查看>>
Lua点号和冒号区别
查看>>
STL基础
查看>>
有没有人要贪吃蛇的代码,然而有....................
查看>>
linux的top命令参数详解
查看>>
spring常用注解
查看>>
Material Menu
查看>>
Win8 环境变量位置
查看>>
margin负值的应用总结
查看>>
分页查询
查看>>
iLBC
查看>>
Linux 本地yum源搭建和网络yum源搭建
查看>>
HDU 5781 ATM Mechine
查看>>
使用Nginx搭建Tomcat9集群,Redis实现Session共享
查看>>
Extjs4.1 序列化和反序列化
查看>>
iOS self 和 super 学习
查看>>
js的闭包的一个示例说明
查看>>
bin/sh failed with exit code 1
查看>>
《梦幻西游》打响反盗号战役:为2亿玩家提供360安全武器
查看>>