This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes running dos Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "running dos" Watch "running dos" New topic
Author

running dos

Paul Keohan
Ranch Hand

Joined: Mar 15, 2000
Posts: 411
How do I run DOS commands from a Java program?
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Basically you need to use a variation of:
Runtime.getRuntime().exec("cmd /c start myfile.bat");
Do a search on "Runtime exec start" and you will find lots of discussions about this.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: running dos
 
Similar Threads
DoS attack?
javascript close or back button
What are the most common IDEs SCJP programmers are using?
winipcfg cmd
How to start Tomcat?