Click to See Complete Forum and Search --> : How to run an exe ?


parsh
March 24th, 2000, 01:53 AM
I want to run Wordpad.exe from my java standalone app.
I tried
Runtime r = Runtime.getRuntime();
Process p = r.exec("wordpad");

-doesnot work. I wanted to know how can i do it ?
Thanx for all your replies

:-) Parshwanath

mjpell
March 24th, 2000, 01:09 PM
Try this. It probably didn't work because wordpad.exe is not in your path.

Runtime r = Runtime.getRuntime();
Process p = r.exec("c:\\progra~1\\Access~1\\wordpad.exe");

March 25th, 2000, 06:41 AM
Thanx. I had tried that it works. What i wanted is the path should not be hardcoded.
I just tried an alternate way -
Step 1 : Write into a .bat file - start wordpad
Step 2 : Run the .bat file using runtime.
It works.

aashishs
March 27th, 2000, 06:22 AM
how did u run the bat file or even the "cmd" because i have tried out notepad and all ece found in system32 but could not find a way to run bat file !!
kindly answer
at aashishsharma@mailcity.com

Love ALL