你能帮我写一个excel宏来检查;是否有任何后台Power Shell脚本在机器上运行?
谢谢, Aneesh
答案 0 :(得分:0)
Sub IsPowerShellRunning()
Debug.Print IsProcessRunning("powershell.exe")
End Sub
Function IsProcessRunning(process As String) as Boolean
Dim objList As Object
Set objList = GetObject("winmgmts:") _
.ExecQuery("select * from win32_process where name='" & process & "'")
If objList.Count > 0 Then
IsProcessRunning = True
Else
IsProcessRunning = False
End If
End Function
<子>(Source)子>