• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call an exe from Javascript

 
India
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4469
3
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic