Creat0R, ему надо следить одновременно за несколькими процессами. То есть, что-нибудь наподобие «Prevent process from running» со «Script Center»:
читать дальше »
Код:

AutoItSetOption("MustDeclareVars", 1)
Local $aProcesses = StringSplit("notepad.exe|calc.exe|wordpad.exe", "|")
Local $sProcessName
Local $sComputer = "."
Local $oSWbemLocator = ObjCreate("WbemScripting.SWbemLocator")
$oSWbemLocator.Security_.Privileges.AddAsString("SeDebugPrivilege", True)
Local $oSWbemServicesEx = $oSWbemLocator.ConnectServer($sComputer, "root\cimv2")
Local $oSWbemEventSource = $oSWbemServicesEx.ExecNotificationQuery( _
"SELECT * FROM __InstanceCreationEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_Process'")
Do
With $oSWbemEventSource.NextEvent().TargetInstance
For $sProcessName In $aProcesses
If $sProcessName = .Name Then
If .Terminate() = 0 Then
; ConsoleWrite .Name
EndIf
EndIf
Next
EndWith
Until False
$oSWbemEventSource = 0
$oSWbemServicesEx = 0
$oSWbemLocator = 0
Exit(0)
Цитата Freaxxx:
… и открыться другой файл. »
|
Что сие означает — я не понял.