- UID
- 19805
- 帖子
- 903
- 積分
- 6969
- 威望
- 0
- 金錢
- 900
- 貢獻
- 780
- 魅力
- 2192
- 閱讀權限
- 250
- 在線時間
- 105 小時
- 註冊時間
- 2013-4-15
- 最後登錄
- 2024-2-29
|
1#
發表於 2019-1-1 21:31
| 只看該作者
用JAVASCRIPT呼叫windows程序
作者: LILI 日期: 2019-1-1 21:31 閱讀: 1092 人
打印
收藏
大 中
小
打開計事本編輯,後存成hta即可
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>工具欄-www.51windows.Net</title>
<style>
<!--
body, table, p, td, div,select { font:menu}
.button {boder:0; HEIGHT: 20px;width:60px;cursor:hand;font:menu}
-->
</style>
</head>
<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>
<p>請保存為HTA檔,再運行<br/>
請輸入要運行的程式:<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('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/>
</p>
</body>
</html>
<div style="position: absolute; bottom: 10; right: 0; width: 150; height: 18;cursor:hand;z-index:100000;font:menu;background:infobackground;border:1 solid #999999;padding:4px;">
<A href="/data/" target=_blank><FONT color=red> DataCenter</FONT></A> <A href="/game/" target=_blank><FONT color=green> 線上小遊戲</FONT></A>
<input type="button" name="Button" value="源代碼" onClick= 'window.location = "view-source:" + window.location.href'></div>
-----------------------------------------------------------------------------------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>工具欄-www.51windows.Net</title>
<style>
<!--
body, table, p, td, div,select { font:menu}
.button {boder:0; HEIGHT: 20px;width:60px;cursor:hand;font:menu}
-->
</style>
</head>
<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>
<p>請保存為HTA檔,再運行<br/>
請輸入要運行的程式:<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('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/>
<BUTTON class=button onclick="Run('sndvol32.exe')">音量</BUTTON><br/>
</p>
</body>
</html>
<div style="position: absolute; bottom: 10; right: 0; width: 150; height: 18;cursor:hand;z-index:100000;font:menu;background:infobackground;border:1 solid #999999;padding:4px;">
<A href="/data/" target=_blank><FONT color=red> DataCenter</FONT></A> <A href="/game/" target=_blank><FONT color=green> 線上小遊戲</FONT></A>
<input type="button" name="Button" value="源代碼" onClick= 'window.location = "view-source:" + window.location.href'></div>
<SCRIPT LANGUAGE="JavaScript" src="/log/sitelog.asp"></SCRIPT> |
|