Create DOS batch file command to end program

Posted on 2006-05-04
Last Modified: 2008-01-09
I need to be able to add to my batch file a way to stop a program, similar to task manager when you end task on an application
Question by:ttgt6840
    LVL 95

    Accepted Solution

    What version of Windows?

    TASKKILL is available in XP; PSKILL is part of the PSTOOLS utilities
    LVL 2

    Expert Comment

      There is a command in the Win 2000 AdminPack called KILL.exe that is just what the doctor ordered.  The KILL.exe command was actually an NT file copyrighted by Microsoft in 1994.
       You can use options to force a process kill use, or you can even specify a process ID to be killed.  
       I have used this command with great success containing virus outbreaks.  Wrote a little batch to kill the offending process before deleting the source files and repairing the registry.
    LVL 4

    Expert Comment

    net start
    net stop

    you can use those commands in the batch file and just put in what you want to stop...

    net start spoolsv.exe
    This will start your print spooler
    net stop spoolsv.exe
    This will stop your print spooler

    Hope that helps
    LVL 2

    Assisted Solution

    NET START and NET STOP are for services.
    For example: if you type NET START without any parameters, you will get a list of services currently operating.
    I agree with leew. TASKKILL.exe is probably your best bet, if your in Win XP.  Tons of switches and parameters available.

    Author Comment

    Thanks for the help and by the way the OS is XP PRO

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    I don't know if many of you have made the great mistake of using the Cisco Thin Client model with the management software VXC. If you have then you are probably more then familiar with the incredibly clunky interface, the numerous work arounds, and …
    I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now