can I invoke dos commands thru Java?

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Feb 2005
Posts: 21
Reputation: higherGround574 is an unknown quantity at this point 
Solved Threads: 1
higherGround574's Avatar
higherGround574 higherGround574 is offline Offline
Newbie Poster

can I invoke dos commands thru Java?

 
0
  #1
Apr 4th, 2005
in the past i have been able to run dos commands thru C++... for example: system("cls") in C++ used to clear the screen... does anyone know if this can be done in java?
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: can I invoke dos commands thru Java?

 
0
  #2
Apr 4th, 2005
Well, since Java doesn't run on DOS but only on 32 bit operating systems you won't be able to execute DOS commands.

You can however (if you insist on loosing platform independence) execute Windows (or Unix) shell commands using the appropriate methods from the Runtime class.
As I in principle don't agree with doing this you'll have to figure out the rest on your own, there's tons of documentation about the pitfalls.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 21
Reputation: higherGround574 is an unknown quantity at this point 
Solved Threads: 1
higherGround574's Avatar
higherGround574 higherGround574 is offline Offline
Newbie Poster

Re: can I invoke dos commands thru Java?

 
0
  #3
Apr 4th, 2005
thanx for the information... makes sense
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2,108
Reputation: server_crash is on a distinguished road 
Solved Threads: 18
server_crash server_crash is offline Offline
Postaholic

Re: can I invoke dos commands thru Java?

 
0
  #4
Apr 4th, 2005
You can download DOS versions such as Koffee I think it's called, but I don't see a point in that, and I doubt it would change much accessibility.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 13932 | Replies: 3
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC