0

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?

asked Jun 20, 2014 at 16:47
3
  • 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. Commented 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! Commented Jun 20, 2014 at 19:51
  • I have used ActiveXObject for it, but it not function either in IE or Chrome. Commented Jun 21, 2014 at 6:15

3 Answers 3

1

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.

answered Jun 20, 2014 at 16:50
Sign up to request clarification or add additional context in comments.

1 Comment

@dandavis yes. Works more ideally for a file rather than an executable. But you would need to tell your browser to open things automatically. Otherwise this method you need an extra click.
0

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.

answered Jun 20, 2014 at 17:02

Comments

0

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.

answered Jun 20, 2014 at 16:53

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.