The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
December 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


DOS Commands in Java

Posted by Rick Rodriguez on December 25, 2001 at 11:20 PM


I was curious to see if anyone out there new of a good resource, either an author or internet resource, that could explain how to run DOS commands, via a Java GUI.

In other words, I want to create a Java "shell" program that will execute the Internet Explorer program on a specific html file, i.e. "iexplorer.exe sample.htm" or execute a "C/C++" program, both via a "button" for each.

What would be involved in accomplishing this "DOS aspect", aside from properly desiging the GUI components and listeners? I have read about a Runtime class that might be needed, but I could not find any reference to this type of scenario on the Internet or in the 3 Java books that I have.

In "C/C++", I simply would use the "system("");" command in order to accomplish this, but I don't have a clue about how this would be accomplished in Java.

Any feedback would be appreciated, preferrably at my e-mail address. Hope to hear from someone soon.

Rick Rodriguez


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us