Home  >  Article  >  Web Front-end  >  JavaScript calls the client's executable file (sample code)_javascript skills

JavaScript calls the client's executable file (sample code)_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:11:57906browse

Copy code The code is as follows:

<script><br><strong>< !--Open the Notepad program--><br></strong>function openNotepad(){<br> var wsh=new ActiveXObject("wscript.shell")<br> wsh.run("notepad.exe") //If it can be run in "Run", you can write it directly here, otherwise you need to write the absolute path <br>}<br><strong><!--Open the word program--><br></strong> function openWord()<br>{<br> var wsh=new ActiveXObject("wscript.shell");<br> wsh.run("calc.exe");<br>}<br><strong>< !--Open the program at the specified location--><br></strong>function openTxt(file)<br>{<br> var wsh=new ActiveXObject("wscript.shell");<br> wsh.run(file );<br>}<br></script>




Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn