Permalink
Browse files

'.'

  • Loading branch information...
1 parent 2b6becb commit 2e5c78f0d227dafe4001cfdefd0b79bbfc48bf3b @haoqis haoqis committed May 17, 2012
Showing with 35 additions and 0 deletions.
  1. +1 −0 vbs/fso.vbs
  2. +34 −0 vbs/winmgmts.vbs
View
@@ -3,3 +3,4 @@ Set fso = CreateObject("scripting.filesystemobject")
Set f = fso.opentextfile(wscript.scriptfullname,1)
MsgBox f.readall
+
View
@@ -0,0 +1,34 @@
+'c:\>wbemtest.exe
+
+strComputer = "."
+Set wbemServices = Getobject("winmgmts:\\" & strComputer)
+Set wbemObjectSet = wbemServices.InstancesOf("Win32_Process")
+
+ s=""
+ On Error Resume next
+For Each wbemObject In wbemObjectSet
+ If InStr(LCase(wbemObject.Name),"chrome") then
+ s =s & "Name: " & wbemObject.Name & vbCrLf & _
+ " Handle: " & wbemObject.Handle & _
+ " Process ID: " & wbemObject.ProcessID & vbCrLf
+ 'wbemObject.Terminate()
+ End if
+Next
+
+'WScript.Echo s
+
+
+'http://zhidao.baidu.com/question/134633552.html
+Set ser = GetObject("winmgmts:")
+d=""
+Set rows = ser.execquery("select * from win32_process where commandline like '%tencent%' ")
+
+If rows.count=0 then
+ MsgBox "count = 0"
+End If
+
+ For each k In rows
+ d= d & k.commandline & vbcrlf
+ next
+
+WScript.Echo d

0 comments on commit 2e5c78f

Please sign in to comment.