I'm preparing a web-based application, where i need to click on a button which should trigger a window in my PC. A Disk is shared to all of the departments in our company. We call it as 'Share Folder'. In windows run commands, we enter command like "10円.227.100.89\share_folder$" the the window opens. I want this with a click in a web page.Is this attainable? I would like to use javascript for it?
-
to execute an arbitrary exe from the web, you need to trigger downloads of a custom mime type with javascript, associate that mimetype with your exe, and tell the browser to "always open" that type of file.dandavis– dandavis2014年06月20日 16:55:35 +00:00Commented Jun 20, 2014 at 16:55
-
Yes, it is possible to run an .exe program on the client computer from javascript, no it is not a reasonable thing to do ever except (a) on your own pc or (b) in a corporate environment (in specific instances). You need to use Internet Explorer and (its ability to leverage) ActiveX. You can create an instance of the WScript activeX component, with which you can perform activities just like you would if typing at the command prompt. Don't burn the house down!enhzflep– enhzflep2014年06月20日 19:51:11 +00:00Commented Jun 20, 2014 at 19:51
-
I have used ActiveXObject for it, but it not function either in IE or Chrome.Dineshgaru– Dineshgaru2014年06月21日 06:15:23 +00:00Commented Jun 21, 2014 at 6:15
3 Answers 3
It is attainable. You wouldn't need javascript or anything like that. Just the local location of the executable.
i.e. to open excel you would do something like this :
<a href="file:///C:/Program%20Files/Microsoft Office/Office/EXCEL.EXE.exe" title="Open Excel">Excel</a>
You could also do this with a specific file. So you could open a given excel file.
1 Comment
It is not achievable if you need to target a general public. Imagine "format C" with a click of a button. Browsers run in a security sandbox from which you can get out via specific startup flags, etc.
Comments
No sure what you mean, but if you are referring to a web window, then try this example:
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
window.open("0.227.100.89\share_folder");
}
</script>
Provided server at 0.227.100.89 has port 80:80 turned on or is a web server for that matter.