论坛风格切换
正版合作和侵权请联系 sd173@foxmail.com
 
  • 帖子
  • 日志
  • 用户
  • 版块
  • 群组
帖子
购买邀请后未收到邀请联系sdbeta@qq.com
  • 2964阅读
  • 2回复

[其他]进程管理器(脚本) [复制链接]

上一主题 下一主题
离线vs007
 
发帖
*
今日发帖
最后登录
1970-01-01
只看楼主 倒序阅读 使用道具 楼主  发表于: 2009-05-24 01:31:19


  1. <HTML>
  2. <HEAD>
  3. <TITLE>程序设置</TITLE>
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  5. <HTA:APPLICATION
  6. ID="MyhyliApp"
  7. APPLICATIONNAME="设置程序"
  8. VERSION="1.0"
  9. SCROLL="no"
  10. INNERBORDER="no"
  11. CONTEXTMENU="no"
  12. CAPTION="yes"
  13. SHOWINTASKBAR="yes"
  14. SINGLEINSTANCE="yes"
  15. SYSMENU="yes"
  16. WINDOWSTATE="normal"
  17. NAVIGABLE="yes"
  18. />
  19. <script>
  20. <!--
  21. var curMenu=null;
  22. function initializeUI() {
  23. var i;
  24. for(i=0;i<document.all.tags('span').length;i++) {
  25. if(document.all.tags('span').className=='menuUp') {
  26. document.all.tags('span').attachEvent("onmouseover", onmenuOver);
  27. document.all.tags('span').attachEvent("onmouseout", onmenuOut);
  28. document.all.tags('span').attachEvent("onmousedown", onmenuDown);
  29. }
  30. }
  31. }
  32. function onmenuOver() {
  33. obj=event.srcElement;
  34. obj.className='menuOver';
  35. if(curMenu!=null && eval('sub'+curMenu.id+'.style.visibility=="visible"')) {
  36. curMenu.className='menuUp';
  37. obj.className='menuDown';
  38. eval('sub'+curMenu.id+'.style.visibility="hidden"');
  39. eval('sub'+obj.id+'.style.visibility="visible"');
  40. eval('sub'+obj.id+'.runtimeStyle.left=sub'+obj.id+'.style.left');
  41. eval('sub'+obj.id+'.runtimeStyle.top=sub'+obj.id+'.style.top');
  42. curMenu=obj;
  43. }
  44. }
  45. function hideMenu() {
  46. if(curMenu!=null && event.srcElement.tagName!='SPAN') {
  47. curMenu.className='menuUp';
  48. eval('sub'+curMenu.id+'.style.visibility="hidden"');
  49. curMenu=null;
  50. }
  51. }
  52. function onmenuOut() {
  53. obj=event.srcElement;
  54. if(eval('sub'+obj.id+'.style.visibility!="visible"')) {
  55. obj.className='menuUp';
  56. }
  57. }
  58. function onmenuDown() {
  59. obj=event.srcElement;
  60. if(curMenu!=null && curMenu!=obj) {
  61. obj.className='menuDown';
  62. eval('sub'+obj.id+'.style.visibility="visible"');
  63. eval('sub'+obj.id+'.runtimeStyle.left=sub'+obj.id+'.style.left');
  64. eval('sub'+obj.id+'.runtimeStyle.top=sub'+obj.id+'.style.top');
  65. curMenu.className='menuUp';
  66. eval('sub'+curMenu.id+'.style.visibility="hidden"');
  67. }
  68. else if(curMenu==obj) {
  69. if(obj.className!='menuDown') {
  70. obj.className='menuDown';
  71. eval('sub'+obj.id+'.style.visibility="visible"');
  72. eval('sub'+obj.id+'.runtimeStyle.left=sub'+obj.id+'.style.left');
  73. eval('sub'+obj.id+'.runtimeStyle.top=sub'+obj.id+'.style.top');
  74. }
  75. else {
  76. obj.className='menuUp';
  77. eval('sub'+obj.id+'.style.visibility="hidden"');
  78. }
  79. }
  80. else {
  81. obj.className='menuDown';
  82. eval('sub'+obj.id+'.style.visibility="visible"');
  83. eval('sub'+obj.id+'.runtimeStyle.left=sub'+obj.id+'.style.left');
  84. eval('sub'+obj.id+'.runtimeStyle.top=sub'+obj.id+'.style.top');
  85. }
  86. curMenu=obj;
  87. }
  88. function popupmenu() {
  89. curMenu=menu4;
  90. submenu4.runtimeStyle.pixelLeft=event.x;
  91. submenu4.runtimeStyle.pixelTop=event.y;
  92. submenu4.style.visibility='visible';
  93. }
  94. document.onclick=hideMenu;
  95. </script>
  96. <SCRIPT LANGUAGE="VBScript">
  97. dim owner(50),path(50),name(50),id(50),thread(50)
  98. Sub Window_onLoad
  99. initializeUI
  100. window.resizeTo 400,250
  101. window.moveTo 400,200
  102. End Sub
  103. sub getprocess()
  104. if process.options.length>1 then '如果原来已经有项目,则移除所有项目;'
  105. for i=1 to process.options.length
  106. process.options.remove(1)
  107. next
  108. end if
  109. i=1
  110. Set objWMIService = GetObject("winmgmts:\\.\root\cimv2") '连接到WMI;'
  111. Set colProcesses = objWMIService.ExecQuery("Select * from Win32_Process")
  112. For each objProcess in colProcesses
  113. Set objOption = Document.createElement("OPTION") '添加option元素;'
  114. objOption.Text = objProcess.name
  115. objOption.Value = i
  116. process.Add(objOption) 'process列表框添加项目;'
  117. colProperties = objProcess.GetOwner(strNameOfUser,strUserDomain) '获取用户;'
  118. name(i)=objProcess.Name '用数组储存程序名称;'
  119. id(i)=objProcess.ProcessID
  120. thread(i)=objProcess.ThreadCount
  121. owner(i)=strNameOfUser
  122. path(i)=objProcess.ExecutablePath
  123. i=i+1
  124. Next
  125. End sub
  126. sub getvalue()
  127. CurID=process.selectedindex
  128. read.value="进程名称:"&vbcrlf&name(CurID)&vbcrlf&"ID:"&id(CurID)&vbcrlf&"所有者:"&owner(CurID)
  129. read.value=read.value&vbcrlf & "线程数:"&vbcrlf&thread(CurID)&vbcrlf&"路径:"&vbcrlf&path(CurID)
  130. end sub
  131. sub killprocess() '停止进程'
  132. if process.selectedindex<1 then '如果没有选择进程,则退出函数;'
  133. exit sub
  134. end if
  135. prs=process.options(process.selectedindex).text '进程名称为列表框中选择名称;'
  136. Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
  137. Set colProcesses = objWMIService.ExecQuery("Select * from Win32_Process where name='"&prs&"'")
  138. For each objProcess in colProcesses
  139. objProcess.Terminate() '结束该进程。'
  140. next
  141. end sub
  142. sub about()
  143. txt="程序说明:"&vbcrlf&vbcrlf&"本程序基于以下技术开发"&vbcrlf&"-DHTML"&vbcrlf&"-HTML-Application"
  144. txt=txt&vbcrlf&"FileSystemObject(FSO)"&vbcrlf&vbcrlf&"系统要求"&vbcrlf&"Internet Explorer 5.5以上"
  145. txt=txt&vbcrlf&"WinXP/Win98/Win2000"&vbcrlf&vbcrlf &"2006-5-1"
  146. read.value=txt
  147. end sub
  148. sub delfile(s)
  149. CurID=process.selectedindex
  150. if process.options.length<=1 or CurID<1 then
  151. exit sub
  152. end if
  153. set fso=createobject("scripting.filesystemobject")
  154. objFile=path(CurID) '获取文件名,文件路径'
  155. set myFile=fso.getfile(objFile) '获得文件对象'
  156. if s="d" then
  157. remind=msgbox("将要删除文件:"&vbcrlf&myFile&vbcrlf&"您是否确定!",vbOKCancel+vbQuestion+vbDefaultButton2,"提醒消息")
  158. if remind=1 then
  159. killprocess()
  160. myFile.delete
  161. else
  162. exit sub
  163. end if
  164. else
  165. set myFolder=myFile.parentfolder '取文件所在的文件夹;'
  166. set objShell=createobject("wscript.shell")
  167. objShell.run(myFolder)
  168. end if
  169. end sub
  170. </SCRIPT>
  171. <STYLE>
  172. body {
  173. margin:0px;
  174. background-color:menu;
  175. }
  176. td,a,div,textarea {
  177. font-family:宋体;
  178. font-size:12px;
  179. }
  180. .submenu {
  181. border:2px outset buttonhighlight;
  182. background-color:menu;
  183. position:absolute;
  184. top: 21px;
  185. z-index:13;
  186. padding:1px;
  187. overflow:hidden;
  188. visibility: hidden;
  189. }
  190. a.menutext {
  191. width:100%;
  192. color:menutext;
  193. text-decoration:none;
  194. padding:2px;
  195. }
  196. a.menutext:hover {
  197. background-color:#CCCCCC;
  198. color:#0066CC;
  199. border-top-color: #000000;
  200. border-right-color: #000000;
  201. border-bottom-color: #000000;
  202. border-left-color: #000000;
  203. }
  204. .menuUp {
  205. margin:1px 0px;
  206. padding-top:3px;
  207. padding-left:8px;
  208. padding-right:8px;
  209. border:1px solid menu;
  210. cursor:default;
  211. height:20px;
  212. position:relative;
  213. overflow: hidden;
  214. visibility: visible;
  215. }
  216. .menuOver {
  217. margin:1px 0px;
  218. padding-top:3px;
  219. padding-left:8px;
  220. padding-right:8px;
  221. border-left:1px solid buttonhighlight;
  222. border-top:1px solid buttonhighlight;
  223. border-right:1px solid buttonshadow;
  224. border-bottom:1px solid buttonshadow;
  225. height:20px;
  226. position:relative;
  227. }
  228. .menuDown {
  229. padding-top:4px;
  230. padding-left:9px;
  231. padding-right:7px;
  232. cursor:default;
  233. height:20px;
  234. position:relative;
  235. margin-top: 1px;
  236. margin-right: 0px;
  237. margin-bottom: 1px;
  238. margin-left: 0px;
  239. border-top-width: 1px;
  240. border-right-width: 1px;
  241. border-bottom-width: 1px;
  242. border-left-width: 1px;
  243. border-top-style: solid;
  244. border-right-style: solid;
  245. border-bottom-style: solid;
  246. border-left-style: solid;
  247. border-top-color: buttonshadow;
  248. border-right-color: buttonhighlight;
  249. border-bottom-color: buttonhighlight;
  250. border-left-color: buttonshadow;
  251. }
  252. .separator {
  253. width:100%;
  254. margin:2px;
  255. margin-top:-4px;
  256. height:12px;
  257. overflow:hidden;
  258. }
  259. .grid {
  260. width:9px;
  261. height:9px;
  262. font-size:1px;
  263. line-height:1px;
  264. border:1px solid black;
  265. vertical-align:absmiddle;
  266. }
  267. .en {
  268. font-family:Tahoma;
  269. font-size:11px;
  270. }
  271. #readingarea {
  272. width:100%;
  273. height:100%;
  274. background-color:#C0C0C0;
  275. color:#000000;
  276. font-size:14px;
  277. line-height:18px;
  278. letter-spacing:1px;
  279. padding:10px;
  280. }
  281. #process {
  282. width:100%;
  283. font-size:14px;
  284. font-family:Arial;
  285. }
  286. </STYLE>
  287. </HEAD>
  288. <BODY>
  289. <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
  290. <tr>
  291. <td id=menubar onselectstart="return false" colspan="1">
  292. <span class="menuUp" id=menu1>文件</span><span class="menuUp" id=menu2>其它</span><span class="menuUp" id=menu3>帮助</span>
  293. <div id="submenu4" class=submenu style="left: 140px; width:100px">
  294. <a class="menutext" href=# title="刷新进程" onClick="getprocess()"> 刷新进程</a>
  295. <a class="menutext" href=# title="结束进程" onClick="killprocess()"> 结束进程</a>
  296. <div class="separator">
  297. <hr>
  298. </div>
  299. <a class="menutext" href=# title="删除进程对应文件" onClick="delfile('d')"> 删除文件</a>
  300. <a class="menutext" href=# title="转到程序所在的文件夹" onClick="delfile('r')"> 转到文件</a>
  301. <div class="separator">
  302. <hr>
  303. </div>
  304. <a class="menutext" href=# title="关于" onClick="about()"> 关于软件</a> </div>
  305. <td><span class="menuUp" id=menu4></span></td>
  306. </tr>
  307. <tr>
  308. <td width="554" height="375" align="left" valign=top><textarea name="read" cols="" rows="" readonly wrap="virtual" id="readingarea" oncontextmenu="popupmenu()" > 系统进程管理
  309. 1、获取系统进程;
  310. 2、停止进程;
  311. 3、删除相关文件。</textarea></td>
  312. <td width=233 valign=top id=directory onselectstart="return false"><p>
  313. <select name="process" size=12 id=process onclick="getvalue()" ondblclick="killprocess()">
  314. <option selected>进程名称</option>
  315. </select>
  316. </p> </td>
  317. </tr>
  318. </table>
  319. <div id="submenu1" class=submenu style="left: 0px; width:120px">
  320. <a class="menutext" href="#" title="获取系统进程" onClick="getprocess()"> 获得进程</a>
  321. <a class="menutext" href=# title="停止系统进程" onClick="killprocess()"> 停止进程</a>
  322. <a class="menutext" href=# title="删除进程对应文件" onClick="delfile('d')"> 删除文件</a>
  323. <div class="separator"><hr></div>
  324. <a class="menutext" href=# onClick="window.close()" title="退出程序"> 关闭 </span></a>
  325. </div>
  326. <div id="submenu2" class=submenu style="left: 42px; width:120px">
  327. <a class="menutext" href=# title="课时安排查询"> 课时查询</a>
  328. <a class="menutext" href=# title="生日提醒"> 生日提醒</a>
  329. <div class="separator"><hr></div>
  330. <a class="menutext" href=# title="关闭计算机"> 关机</a>
  331. <a class="menutext" href=# title="重新启动计算机"> 重启</a>
  332. <a class="menutext" href=# title="注销"> 注销</a>
  333. </div>
  334. <div id="submenu3" class=submenu style="left: 84px; width:100px">
  335. <a class="menutext" href="mailto:pcl_83@163.com" title="联系作者"> 联系作者</a>
  336. <a class="menutext" href=# title="关于" onClick="about()"> 关于软件</a></div>
  337. </BODY>
  338. </HTML> 


新建记事本,输入,保存为“进程管理器.hta”即可
点击进入下载页面: 进程管理器.rar (4 K) 下载次数:1
1条评分
wjm8888 电魂 +2 闪电联盟因你而精彩! 2009-05-24
软件下载咨询 sdbeta@qq.com
 
离线lqwjkx
发帖
*
今日发帖
最后登录
1970-01-01
只看该作者 沙发  发表于: 2009-05-24 01:56:43
软件界面`。



很不错哦,很强大哈`。
离线wjm8888

发帖
16065
今日发帖
最后登录
2021-06-28
只看该作者 板凳  发表于: 2009-05-24 21:08:45
很不错啊,谢谢分享