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 Can a servlet call an EXE Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Can a servlet call an EXE" Watch "Can a servlet call an EXE" New topic
Author

Can a servlet call an EXE

sanjeev magoo
Greenhorn

Joined: Feb 27, 2001
Posts: 2
Hello All,
Can a servlet run an EXE which is located on another machine.
Raghavendra Holla
Ranch Hand

Joined: Jun 02, 2000
Posts: 58
Hi,
What you have to do with exe? Is it any third party software? Objective of Java to make it poratble across the plaforms.. i.e. "Write once .. Run anywhere..." However still you want to use..
use following method,
Runtime.getRuntime().exec("C:\win\system\notepad.exe");

Try to avoid using above command. look into java.lang package for further information.
regards,
holla.
Bharatesh H Kakamari
Ranch Hand

Joined: Nov 09, 2000
Posts: 198
You cannot execute a file on a remote machine (Machine 1) by a servlet on machine 2.
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6913
However, a servlet can call an executable program in the same way as any other Java code. You need the Runtime.exec() method. Look it up in your API documentation.


A Convergent Visionary ~ Frank's Punchbarrel Blog ~ LinkedIn profile
 
 
subject: Can a servlet call an EXE
 
Threads others viewed
how to execute a gui stuff in server
invoking an exe file from servlet
C execute in java program
how to create .exe in java
problem in running exec() from servlet
developer file tools