Killing a process

Discussion in 'Microsoft Windows 2000 CMD Promt' started by Grodon, Oct 4, 2004.

  1. Grodon

    Grodon Guest

    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, Oct 4, 2004
    #1
    1. Advertisements

  2. Grodon

    Mark V Guest

    In microsoft.public.win2000.cmdprompt.admin Grodon wrote:

    > 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.
     
    Mark V, Oct 4, 2004
    #2
    1. Advertisements

  3. Grodon

    Dave Patrick Guest

    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

    "Grodon" wrote:
    | 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
     
    Dave Patrick, Oct 4, 2004
    #3
  4. "Grodon" <> wrote in message
    news:2afd01c4aa1e$449f2e00$...
    > 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
     
    Paul R. Sadowski [MVP], Oct 4, 2004
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Richard J. Otter

    background process

    Richard J. Otter, Jul 17, 2003, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    3
    Views:
    604
    Scot Wiedenfeld
    Jul 18, 2003
  2. Mamun Shaheed

    How to stop a process...

    Mamun Shaheed, Aug 18, 2003, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    1
    Views:
    1,247
    kroesjnov
    Aug 18, 2003
  3. Jim

    kill a process run by ntvdm.exe

    Jim, Aug 23, 2003, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    2
    Views:
    7,299
    Myron
    Aug 24, 2003
  4. Stan

    Can't kill a Process (msdtc.exe, PID 1500)

    Stan, Aug 24, 2003, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    4
    Views:
    3,643
    Harry Bates
    Aug 27, 2003
  5. Replies:
    1
    Views:
    1,429
    Tim Meddick
    Jan 22, 2010
Loading...

Share This Page