<body>
<SCRIPT language=JavaScript>
function Run(strPath) {
exe.value=strPath
try {
var objShell = new ActiveXObject("wscript.shell")
objShell.Run(strPath)
objShell = null
}
catch (e){alert('找不到文件"'+strPath+'"(或它的组件之一)。请确定路径和文件名是否正确,而且所需的库文件均可用。')
}
}
</SCRIPT>
请输入要运行的程序:<br><input name=exe type=text size=20
value="regedit"><BUTTON class=button
onclick="Run(exe.value)">确定</BUTTON><BUTTON class=button
onclick=exe.value="">重新输入</BUTTON><br>
<BUTTON class=button onclick="Run('notepad')">记事本</BUTTON><br>
<BUTTON class=button onclick="Run('mspaint')">画图板</BUTTON><br>
<BUTTON class=button onclick="Run('calc')">计算器</BUTTON><br>
<BUTTON class=button onclick="Run('cmd')">cmd</BUTTON><br>
<BUTTON class=button onclick="Run('Regedit')">Regedit</BUTTON><br>
<BUTTON class=button onclick="Run('Msconfig')">Msconfig</BUTTON><br>
<BUTTON class=button onclick="Run('file:///D:/Program%20Files/Winamp/WINAMP.EXE')">WINAMP</BUTTON><br>
<BUTTON class=button onclick="Run('IEXPLORE.EXE')">IE</BUTTON><br>
<BUTTON class=button onclick="Run('..')">..</BUTTON><br>
<BUTTON class=button onclick="Run('%windir%')">%windir%</BUTTON><br>
<BUTTON class=button onclick="Run('%temp%')">%temp%</BUTTON><br>
</body>
</html>
通过注册表进行打开本地的exe的运行文件。
打开记事本,随便命名,保存下面的内容
需要修改的地方:
保存,修改后缀名为reg;双击运行自动生成ChiticData的协议,在Html中写上这个协议即可打开本地运行程序
exe是可执行文件,可以用js打开,例子如下:function Run(strPath)
{
exe.value=strPath
try
{
var objShell=new ActiveXObject("wscript.shell")
objShell.Run(strPath)
objShell=null
}
catch(e)
{
alert(e)
}
}
</script>
请输入要运行的程序:<br/><input name=exe type=text size=20 value="regedit">
<BUTTON class=button onclick="Run(exe.value)">decide</BUTTON>
<BUTTON class=button onclick=exe.value="">input</BUTTON><br/>
<BUTTON class=button onclick="Run('notepad')">notepad</BUTTON><br/>
<BUTTON class=button onclick="Run('mspaint')">mspaint</BUTTON><br/>
<BUTTON class=button onclick="Run('calc')">calc</BUTTON><br/>
<BUTTON class=button onclick="Run('cmd')">cmd</BUTTON><br/>
<BUTTON class=button onclick="Run('Regedit')">Regedit</BUTTON><br/>
<BUTTON class=button onclick="Run('Msconfig')">Msconfig</BUTTON><br/>
<BUTTON class=button onclick="Run('file:///D:/EDI/PCstructure/bin/Debug/PCStructure.exe')">PC EXE</BUTTON><br/>
<BUTTON class=button onclick="Run('IEXPLORE.EXE')">IE</BUTTON><br/>
<BUTTON class=button onclick="Run('..')">..</BUTTON><br/>
<BUTTON class=button onclick="Run('%windir%')">%windir%</BUTTON><br/>