RSS Forums RSS
Please support our Java advertiser: Lunarpages Java Web Hosting

How to run external .exe programs from java

Join Date: Jul 2004
Posts: 4
Reputation: BlackDeath is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
BlackDeath's Avatar
BlackDeath BlackDeath is offline Offline
Newbie Poster

Re: How to run external .exe programs from java

  #2  
Jul 2nd, 2004
the code goes like this:
try
{
 Runtime rt = Rintime.getRuntime() ;
 Process p = rt.exec("Program.exe") ;
 InputStream in = p.getInputStream() ;
 OutputStream out = p.getOutputStream ();
 InputSream err = p,getErrorStram() ;
 
//do whatever you want
 //some more code
 
 p.destroy() ;
}catch(Exception exc){/*handle exception*/}
It's not wrong not knowing, but it's wrong not wanting to know.
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 4:59 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC