Killing a process

  • Thread starter Thread starter Grodon
  • Start date Start date
G

Grodon

I'm trying to set up a job to kill a running application
every night, before our database backups run. Is there a
way to do this?

Thanks in adv.
Grodon
 
In said:
I'm trying to set up a job to kill a running application
every night, before our database backups run. Is there a
way to do this?

MS Resource Kit, Support Tools (or possible present already): kill.exe

One 3rd-party tool: pskill.exe (www.sysinternals.com)

Don't kill Services. STOP (or pause possibly) them instead.
 
This may help. Save file as VBS
Replace 'excel.exe' for your process.
-------------------------------------
Set objWMIService = GetObject("winmgmts:" & _
"{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colProcessList = objWMIService.ExecQuery ("Select " & _
"* from Win32_Process Where Name = 'excel.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
Set fso = Nothing
Set objWMIService = Nothing
Set colProcessList = Nothing
-------------------------------------

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| I'm trying to set up a job to kill a running application
| every night, before our database backups run. Is there a
| way to do this?
|
| Thanks in adv.
| Grodon
 
Grodon said:
I'm trying to set up a job to kill a running application
every night, before our database backups run. Is there a
way to do this?

On XP there's also taskkill (Pro) and tskill (Home) though I prefer using
WMI myself since most of my backup scripts are WSH anyway.

:: Kill running instances of Outlook
%WINDIR%\System32\taskkill.exe /F /IM OUTLOOK.EXE > nul 2>&1
:: in xp home use (tskill uses the process name not an image name)
:: %WINDIR%\System32\tskill.exe outlook > nul 2>&1
 
Back
Top