Create DOS batch file command to end program

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
Who is Participating?
Lee W, MVPConnect With a Mentor Technology and Business Process AdvisorCommented:
What version of Windows?

TASKKILL is available in XP; PSKILL is part of the PSTOOLS utilities
  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.
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
whaupwitConnect With a Mentor Commented:
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.
ttgt6840Author Commented:
Thanks for the help and by the way the OS is XP PRO
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.