我的知识库

知识等于力量

« 23个免费的AJAX树菜单组件javascript 格式化数字 »

vb script实现杀掉进程

' ProcessKillLocal.vbs
'
 Sample VBScript to kill a program
'
 Author Guy Thomas http://computerperformance.co.uk/
'
 Version 2.7 - December 2005
'
 ------------------------ -------------------------------' 
Option Explicit
Dim objWMIService, objProcess, colProcess
Dim strComputer, strProcessKill 
strComputer 
= "."
strProcessKill 
= "'otrun.exe'" 

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _ 
& strComputer & "\root\cimv2"

Set colProcess = objWMIService.ExecQuery _
(
"Select * from Win32_Process Where Name = " & strProcessKill )
For Each objProcess in colProcess
objProcess.Terminate()
Next 
WSCript.Echo 
"Just killed process " & strProcessKill _
& " on " & strComputer
WScript.Quit 
' End of WMI Example of a Kill Process

Search

导航

热门文章

最新文章

Powered By duduwolf's wiki 1.0

Copyright 1999-2007 duduwolf.com Some Rights Reserved.