This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java " Watch "Java " New topic
Author

Java

Dinesh Bhogle
Greenhorn

Joined: Mar 12, 2001
Posts: 6
How to execute OS command through java for example
I want to run cls command through java
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
I am moving this discussion to Java in General(intermediate) forum.

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
For windows you can use this:
Runtime.getRuntime().exec("cmd /K start run.bat");


"JavaRanch, where the deer and the Certified play" - David O'Meara
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Also it's worthwhile to check out this article for more info.


"I'm not back." - Bill Harding, Twister
 
Consider Paul's rocket mass heater.
 
subject: Java
 
Similar Threads
Why main is declared as static?
How to Have a command line in Eclipse ?
Executing Windows Command using java
Standard way of using Linux command using java
Mysql database restore through java application...?