加入收藏 | 设为首页 | 会员中心 | 我要投稿 聊城站长网 (https://www.0635zz.com/)- 智能语音交互、行业智能、AI应用、云计算、5G!
当前位置: 首页 > 教程 > 正文

使用Javascript在客户端的运行可执行的代码

发布时间:2023-08-03 14:42:51 所属栏目:教程 来源:
导读:代码如下:

<script>

<!--打开记事本程序-->

function openNotepad(){

var wsh=new ActiveXObject("wscript.shell")

wsh.run("notepad.exe")//如果在“运行”可以运行就可以在此直接
代码如下:
 
<script>
 
<!--打开记事本程序-->
 
function openNotepad(){
 
 var wsh=new ActiveXObject("wscript.shell")
 
 wsh.run("notepad.exe")//如果在“运行”可以运行就可以在此直接写,否则要写上绝对路径
 
}
 
<!--打开word程序-->
 
function openWord()
 
{
 
 var wsh=new ActiveXObject("wscript.shell");
 
 wsh.run("calc.exe");
 
}
 
<!--打开指定位置程序-->
 
function openTxt(file)
 
{
 
 var wsh=new ActiveXObject("wscript.shell");
 
 wsh.run(file);
 
}
 
</script>
 
<input type="button" id="notepad" value="Notepad" onclick="openNotepad();"/>
 
<input type="button" id="word" value="word"  onclick="openWord();"/>
 
<input type="button" id="word" value="word"  onclick="openTxt('c://caipiao.txt');"/>
 
 

(编辑:聊城站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章