用js调用exe程序
2010-03-08 17:36
323 查看
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<script>
/**
浏览器里有下载警告框和安全警告框出现
*/
function ExeRun(command)
{
window.oldOnError=window.onerror;
window._command=command;
window.onerror=function(err)
{
if(err.indexOf('automation')!=-1)
{
alert("命令"+window._command+"已经被用户禁止!");
return true;
}
else return false;
}
var wsh=new ActiveXObject("WScript.Shell");
if(wsh)
wsh.Run(command);
window.onerror=window.oldOnError;
}
/**
浏览器里没有下载警告框和安全警告框出现
*/
function run(command){
var wsh=new ActiveXObject("WScript.Shell");
alert(wsh);
if(wsh){
wsh.exec(command);
}
}
</script>
<input type=button onclick="ExeRun('Explorer file:///C://Documents and Settings//feng.wen//桌面//kostal')" value="打开文件夹">
<input type=button onclick="ExeRun('Explorer C://Program Files//TTPlayer//TTPlayer.exe')" value="千千静听">
<input type=button onclick="ExeRun('Explorer /e,/root,//DigitalTitan')">
<input type=button onclick="ExeRun('Explorer /select,C://WinNT//')">
<input type=button onclick="ExeRun('Explorer C://Documents and Settings//feng.wen//桌面//快捷方式//birt2.2正式版.exe')" value="运行快捷方式">
<input type=button onclick="run('C:/Program Files/TTPlayer/TTPlayer.exe')" value="千千静听">
<input type=button onclick="run('notepad.exe')" value="记事本">
<input type=button onclick="run('mstsc.exe')" value="远程桌面">
<input type=button onclick="run('C://Program Files//Maxthon2//Maxthon.exe')" value="遨游">
</BODY>
</HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<script>
/**
浏览器里有下载警告框和安全警告框出现
*/
function ExeRun(command)
{
window.oldOnError=window.onerror;
window._command=command;
window.onerror=function(err)
{
if(err.indexOf('automation')!=-1)
{
alert("命令"+window._command+"已经被用户禁止!");
return true;
}
else return false;
}
var wsh=new ActiveXObject("WScript.Shell");
if(wsh)
wsh.Run(command);
window.onerror=window.oldOnError;
}
/**
浏览器里没有下载警告框和安全警告框出现
*/
function run(command){
var wsh=new ActiveXObject("WScript.Shell");
alert(wsh);
if(wsh){
wsh.exec(command);
}
}
</script>
<input type=button onclick="ExeRun('Explorer file:///C://Documents and Settings//feng.wen//桌面//kostal')" value="打开文件夹">
<input type=button onclick="ExeRun('Explorer C://Program Files//TTPlayer//TTPlayer.exe')" value="千千静听">
<input type=button onclick="ExeRun('Explorer /e,/root,//DigitalTitan')">
<input type=button onclick="ExeRun('Explorer /select,C://WinNT//')">
<input type=button onclick="ExeRun('Explorer C://Documents and Settings//feng.wen//桌面//快捷方式//birt2.2正式版.exe')" value="运行快捷方式">
<input type=button onclick="run('C:/Program Files/TTPlayer/TTPlayer.exe')" value="千千静听">
<input type=button onclick="run('notepad.exe')" value="记事本">
<input type=button onclick="run('mstsc.exe')" value="远程桌面">
<input type=button onclick="run('C://Program Files//Maxthon2//Maxthon.exe')" value="遨游">
</BODY>
</HTML>
相关文章推荐
- js调用本地exe程序的两种方式
- bs系统调用cs应用(Js调用exe程序方法)
- 在页面上通过js调用exe程序
- JS调用exe程序
- 2018-01-05 【js】js中调用exe程序
- JS调用exe程序
- Js调用exe程序方法(通过URL Protocol实现网页调用本地应用程序)
- js调用exe文件的方法
- 将C#程序嵌入资源中(C# 调用嵌入资源的EXE文件方法)
- 调用cmd.exe程序和外部程序(转)
- paip.按键精灵调用其它程序及DLL以及EXE命令行的方法
- VC中调用外部EXE程序方法
- c#调用EXE程序
- bat调用全路径包含空格的exe程序
- [转]VC中调用外部exe程序方式
- 小程序中关于app.js中用户的调用与获取unionid
- 收集的C/C++执行外部程序(调用外部exe程序)文章
- 程序调用.exe文件
- jsp页面利用js activexobject调用客户机exe文件
- 使用java代码调用exe程序 (包括参数传递)