• Post Reply Bookmark Topic Watch Topic
  • New Topic

About Dos Command  RSS feed

 
suresh kataria
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How i can run dos command using java application
 
pascal betz
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there are various exec methods in Runtime class.

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Runtime.html
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, welcome to the ranch!!

In JDK 5 see also ProcessBuilder. It's a little more intuitive and flexible than Runtime.exec.

If you're in Windows, go to a command window and enter CMD /? and COMMAND /? to see how some things you type like DIR are not programs at all, but are interpreted by the command processor. You need to run CMD or COMMAND to run those commands. Let me know if that turns out to be too confusing to use.
[ April 14, 2006: Message edited by: Stan James ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!