File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes run exe from servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "run exe from servlet" Watch "run exe from servlet" New topic
Author

run exe from servlet

kodali s
Greenhorn

Joined: May 31, 2001
Posts: 3
I have this code in my java testclass.
Runtime rt = Runtime.getRuntime();
rt.exec("C:/winnt/system32/notepad.exe");
If I run this class file in Command prompt it is opening notepad.exe but the problem is if i copy same code into my servlet it is not openning notepad.exe. Even if i take an instance of my class in the servlet still it is not calling notpad.exe and it is not giving any error.
Can anybody help me.
Thanks in advance.
Sandeep Jain
Ranch Hand

Joined: Oct 25, 2000
Posts: 124
Hello ,
I tried ur code and it works fine on my machine. As my times I click on the refresh window, those many notepad applications are opening .
Anyway , Just wanted to tell u that In servlet making use of Runtime classes will open the apl;ication or execute the application on the server and not the client side .

------------------
Try and Try Till u succeed
Sandeep Jain


Try and Try Till u succeed<br /> <br />Sandeep Jain
kodali s
Greenhorn

Joined: May 31, 2001
Posts: 3
Hi
If I want to run an application in client machine what should I do. I am using java, jsp, and servlets.
Thanks,
kodali

[This message has been edited by kodali s (edited May 31, 2001).]
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
"kodali s",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: run exe from servlet