File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes How to call an exe from Javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to call an exe from Javascript" Watch "How to call an exe from Javascript" New topic
Author

How to call an exe from Javascript

India
Greenhorn

Joined: Aug 13, 2001
Posts: 1
How do I call an exe on the local machine / on Web Server from JavaScript ?
My requirement is ....
I have a textbox in the HTML form where in I will have a file with pathname (Ex : If Local machine - C:/Test.doc ; If web server than http://webservername/virtualdirectoryname/test.doc )
When I click "Open File" button the file selected in the textbox should be opened in the appropriate editor.Means Test.doc should be opened in MS-WORD and not in browser window.
I should be able to open applications which does not support ActiveXObjects also and it must also work for applications for which no object can be created .
We also have editors that are very specific -- in order to display the results of chromatography, XRF, etc because the results are mostly stored in a binary format and only viewable via software of the instrument supplier (sometimes even instrument type en version specific).
And one more question is : Suppose the client doesn't have the required software/editor to open the file than can we call the software/editor exe from webserver and open the file in that exe ?
Can this be done using Javascript ?
I am trying it with wscript.shell .......
Thanks
Vinitha

xavier romea
Ranch Hand

Joined: Jun 28, 2001
Posts: 37
I'm afraid you cannot call an exe by a javascript function.
When netscape loads a file, netscape looks for the file extension in the preferences -> Navigator -> Applications (quite similar to the base register in Windows) and asks the user if he wants to download the file onto the hard drive or open it with the application (plugin or standalone software) netscape has found in the preferred applications.
santosh nd
Greenhorn

Joined: Jul 31, 2001
Posts: 4
hi india(Vinitha),
i think u cannot execute an exe using javascript,but can be done in html using exec command...< ONCLICK="exec('ur exe file'); return false;"
regards
santosh
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2

India,
I hate to say this but, your name does not comply with the Javaranch naming guidelines which can be found at http://www.javaranch.com/name.jsp
please register again with a valid name.


SCJP
Visit my download page
David Weitzman
Ranch Hand

Joined: Jul 27, 2001
Posts: 1365
Actually, this can be done. The problem is that it involves exploiting security vulnerabilities, which are subject to radical change from browser to browser, version to version. It also raises some legal concerns.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to call an exe from Javascript
 
Similar Threads
Do we have Application specific class-path?
Opening file from remote machine using authentication
How to call a local class from a servlet?
open a .exe in java (DLL Problem)
Opening a text file on client machine editor