如何使用vbscript暂停/恢复进程

时间:2012-11-29 22:07:59

标签: process vbscript resume suspend

有没有办法使用vbscript暂停和恢复进程?目前我创建了一个终止进程的输入框但是没有终止它有没有办法暂停它?

'Terminate all processes involving the name <strProcessToKill>
Option Explicit
Dim strComputer, strProcessToKill, objWMIService, colProcess, objProcess

strComputer = "."
strProcessToKill = InputBox("Process to kill","Userinput")
Set objWMIService = GetObject("winmgmts:" _ 
   & "{impersonationLevel=impersonate}!\\" _ 
   & strComputer _ 
   & "\root\cimv2") 
Set colProcess = objWMIService.ExecQuery _
   ("Select * from Win32_Process Where Name = '" & strProcessToKill & "'")
For Each objProcess in colProcess
   msgbox "... terminating " & objProcess.Name
   objProcess.Terminate()
Next

1 个答案:

答案 0 :(得分:0)

AFAIK您无法通过脚本API从VBScript暂停或恢复进程。你必须为pssuspend之类的东西做出类似的任务。