var js = "function Run(objPath) {
try {
var objShell=new ActiveXObject("wscript.shell");
strPath = strPath +" "+ file;
objShell.exec(strPath);
//objShell.Run(objPath);
objShell=null;
}catch (e){
alert(''找不到指定文件''+objPath+''(或它的組件之一),請確定文件或路徑是否正確,并確定更改了你的IE安全級別:
Internet選項-->安全-->自定義級別-->對沒有標記為安全的ActiveX控件進行初始化和腳本運行-->啟用!'');
并且加服务器到可信任站点;
}}";
二.之后在各個按扭里加上:
1.打開word:
on (release) {
getURL("javascript :Run(''WINWORD.EXE''); "+js);
}
2.打 開記事本:
on (release) {
getURL("javascript :Run(''notepad'');"+js);
}
3.打開畫圖板:
on (release) {
getURL("javascript :Run(''mspaint'');"+js);
}
4.打開計算器:
on (release) {
getURL("javascript :Run(''calc'');"+js);
}
5. 打開IE:
on (release) {
getURL("javascript :Run(''IEXPLORE.EXE'');"+js);
}
6.打開winamp(我的是裝在d盤的):
on (release) {
getURL("javascript :Run(''file:///D:/Program%20Files/Winamp/WINAMP.EXE'');"+js);
}
7.打開cmd:
on (release) {
getURL("javascript :Run(''cmd'');"+js);
}
8.打開注冊表:
on (release) {
getURL("javascript :Run(''Regedit'');"+js);
}
9.打開''Msconfig'':
on (release) {
getURL("javascript :Run(''Msconfig'');"+js);
}
10.進入用戶文件夾:
on (release) {
getURL("javascript :Run(''..'');"+js);
}
11.進入winnt目錄:
on (release) {
getURL("javascript :Run(''%windir%'');"+js);
}
12.進入臨時文件夾:
on (release) {
getURL("javascript :Run(''%temp%'');"+js);
}
转自:http://hi.baidu.com/chenyichao1978/blog/item/5afa474e0f7da80ab3de05b3.html