• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RUNNING AN EXE THROUGH A JAVA PGM

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello
I had worked with Runtime Command in java,using that i could able to open only some general programs like turboc,notepad,winamp etc.How to run other EXE file ,for eg i have created a c program ds.exe and how to execute it from Java.Please provide me the help as soon as possible.
Thank you
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
make sure the program is in your path....or add the program's path to your environment variable....if all this fails try giving the full path of the program like c:\myfolder\ds.exe
 
Neela Sathesh
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai friend,
thank u but, we have tried with this(full path). i found only tc, notepad,winamp can be executed with it. all other .exe are not running.give me some other suggestions...
thank u, bye.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is not a Servlet question, moving this thread to Java in General (beginner).
Dave
 
Ram Mohan
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can u post the snippet of code that actually calls ur .exe program...maybe there is some error there
 
Neela Sathesh
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try
 
Neela Sathesh
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try
{
RuntTime r=RunTime.getRunTime();
Process p=r.execute("c:/turboc3/bin/sat.exe");
}
catch(Exception e)
{
}
The above pgm gives the path of exe file in c.If I give inplace of sat.exe
as "notepad"or"winamp" it is working.Please can u clear my dbt
 
Ram Mohan
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
don't really know what's wrong with your code...i was not able to even compile ur code (where exactly is this RunTime interface???)...but the following code does work
try
{
Runtime r=Runtime.getRuntime();
Process p=r.exec("c:/winnt/hh.exe");
}
catch(Exception e){}
}
do let me know if it helped
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Runtime.exec() has a few pitfalls. Have a look at this:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
 
Dinner will be steamed monkey heads with a side of tiny ads.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic