'关掉一个进程
Function Killprcgram(Pro)
Set objWMIService = GetObject("winmgmts:")
set objs =objwmiservice.execQuery("select * from Win32_Process where name='" & Pro & "'")
For Each obj in objs
obj.Terminate()
Next
Set objs = Nothing
Set objWMIService = Nothing
End Function
'打开一个进程
Function OpenFile(temp)
Dim Shell
Set Shell = CreateObject("WScript.Shell")
Shell.Run "notepad.exe"+" "+temp
End Function
'看当前有多少进程,并且存入到一个数组里面去
Function test1()
Set a=GetObject("winmgmts:")
SQL="Select * from Win32_process"
Set b=a.execQuery(SQL)
d= b.count
ReDim c(d)
i=0
For Each b In b
c(i)=b.name
MsgBox c(i)
i=i+1
Next
End Function