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?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Richard J. Otter

    background process

    Richard J. Otter, Jul 17, 2003, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    3
    Views:
    697
    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,323
    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,811
    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:
    4,162
    Harry Bates
    Aug 27, 2003
  5. David Trimboli

    Run a process and kill it if it gets stuck

    David Trimboli, Aug 29, 2003, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    1
    Views:
    770
    Ritchie
    Aug 29, 2003
  6. LarryG

    Tool for remote process kill

    LarryG, Oct 22, 2003, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    4
    Views:
    441
  7. Lisa

    command prompt process not closing

    Lisa, Nov 3, 2003, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    4
    Views:
    746
    Bill Stewart
    Nov 6, 2003
  8. Replies:
    1
    Views:
    1,784
    Tim Meddick
    Jan 22, 2010
Loading...