-
how to execute exe from java file (5 messages)
- Posted by: Prashant Rawat
- Posted on: April 20 2001 01:22 EDT
import java.lang.*;
import java.io.*;
public class LoadNotpad{
public static void main(String args[])throws IOException{
Runtime r=Runtime.getRuntime();
Process p=null;
try
{
String s="c:\\windows
notpad.exe";
p=r.exec(s);
}
catch(Exception e){
System.out.println("error==="+e.getMessage());
e.printStackTrace();
}
}
}
/*This is the exception when i am running the above code plz help me to execute
this code and the mentioned java file Win32Process is not in my jdk1.2.2 */
/*
java.io.IOException: CreateProcess: c:\windows\notpad.exe error=0
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:64)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:272)
at java.lang.Runtime.exec(Runtime.java:195)
at java.lang.Runtime.exec(Runtime.java:152)
at LoadNotpad.main(LoadNotpad.java:11)
Tool completed with exit code 1
*/
Threaded Messages (5)
- how to execute exe from java file by Andy Nguyen on April 20 2001 10:19 EDT
- how to execute exe from java file by Buchanna Gajula on April 20 2001 13:59 EDT
- how to execute exe from java file by preeti kulkarni on April 23 2001 02:45 EDT
- Re: how to execute exe from java file by binu pillai on September 23 2009 00:09 EDT
- informational systems by daria spencer on September 24 2012 10:25 EDT
-
how to execute exe from java file[ Go to top ]
- Posted by: Andy Nguyen
- Posted on: April 20 2001 10:19 EDT
- in response to Prashant Rawat
Not sure if this is a typo, but are you trying to run notepad.exe? If so, check your spelling of notepad.
Andy -
how to execute exe from java file[ Go to top ]
- Posted by: Buchanna Gajula
- Posted on: April 20 2001 13:59 EDT
- in response to Prashant Rawat
Hi,
It's a typo error, otherwise it works fine.
Regards
Buchanna
-
how to execute exe from java file[ Go to top ]
- Posted by: preeti kulkarni
- Posted on: April 23 2001 02:45 EDT
- in response to Prashant Rawat
I hope you are trying to run a notepad.exe file. Pl. correct the spelling of notepad, I have tried the same and it works fine. -
Re: how to execute exe from java file[ Go to top ]
- Posted by: binu pillai
- Posted on: September 23 2009 00:09 EDT
- in response to preeti kulkarni
Please use notepad instead of notpad. Your code is working nicely in my end import java.lang.*; import java.io.*; public class LoadNotpad{ public static void main(String args[])throws IOException{ Runtime r=Runtime.getRuntime(); Process p=null; try { String s="C:
Program Files\\Macromedia
FlashPaper 2
FlashPrinter.exe"; p=r.exec(s); } catch(Exception e){ System.out.println("error==="+e.getMessage()); e.printStackTrace(); } } } -
informational systems[ Go to top ]
- Posted by: daria spencer
- Posted on: September 24 2012 10:25 EDT
- in response to Prashant Rawat
There`s no doubt informational systems have become so advanced today thanks to all of techniques the cyber industry has developed, the kind of techniques we see San Diego colocation centers using. I see this TurboGears 2.1 Platform like a wide matrix that keeps an entire system alive, with all its complex features, purposes and properties. This is how this works. All the app destinations are carefully highlighted paths and there`s no room for error. bulgaria ski