Kill Prozess when Screensaver comes up

19/12/2007 - 08:02 von Remo | Report spam
We want to kill all Iexplore.exe when the screensaver will be invoked.
How can we do this, using only WinXP tools?
Script/batch/ ...???
We do not use a screensaver for the screen, just aftert start of a
screensaver, all iexplore.exe should be killed.

Thanks and regards remo
 

Lesen sie die antworten

#1 Pegasus \(MVP\)
19/12/2007 - 15:59 | Warnen spam
"Remo" wrote in message
news:
We want to kill all Iexplore.exe when the screensaver will be invoked.
How can we do this, using only WinXP tools?
Script/batch/ ...???
We do not use a screensaver for the screen, just aftert start of a
screensaver, all iexplore.exe should be killed.

Thanks and regards remo



Ich nehme an, Du erwartest eine englische Antwort, obschon
Deine Frage in einer deutschen Newsgroup erscheint.

You could use the following function to detect the launch
of a specific screen saver. The code fragments below are
samples - you will need to adapt them to your own environment.
==Function ProcessAlert
ProcessName="notepad" 'Replace "notepad" with the name of your screen
saver

Set objWMIService = GetObject("winmgmts:\\.oot\cimv2")
Set colMonitoredProcesses = objWMIService. _
ExecNotificationQuery("select * from __instanceCreationEvent " _
& " within 1 where TargetInstance isa 'Win32_Process'")

i = 0
Do While i = 0
Set objProcess = colMonitoredProcesses.NextEvent
If InStr(objProcess.TargetInstance.CommandLine, ProcessName) Then
WScript.Echo objProcess.TargetInstance.ProcessID & " " &
objProcess.TargetInstance.CommandLine
End If
Loop
==
To kill Internet Explorer, you could use this function:

==Function TerminateProcess
Set objWMIService = GetObject ("winmgmts:\\.oot\cimv2")

Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'IExplore.exe'")

For Each objProcess In colProcessList
objProcess.Terminate()
Next
End Function

Ähnliche fragen