?
Solved

Create DOS batch file command to end program

Posted on 2006-05-04
5
Medium Priority
?
4,255 Views
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
0
Comment
Question by:ttgt6840
5 Comments
 
LVL 97

Accepted Solution

by:
Lee W, MVP earned 1400 total points
ID: 16606114
What version of Windows?

TASKKILL is available in XP; PSKILL is part of the SysInternals.com PSTOOLS utilities
0
 
LVL 2

Expert Comment

by:whaupwit
ID: 16607033
  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.
0
 
LVL 4

Expert Comment

by:xcromx
ID: 16608458
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
0
 
LVL 2

Assisted Solution

by:whaupwit
whaupwit earned 600 total points
ID: 16608953
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.
0
 

Author Comment

by:ttgt6840
ID: 16611828
Thanks for the help and by the way the OS is XP PRO
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction How to create multiboot configuration with XP\Vista and Windows 7 on it? And most important question - how to do this correctly so not to have any kind of nightmares we get when system gets screwed? First of all one should realize t…
Windows 7 does not have the best desktop search built in. This is something Windows 7 users have struggled with. You type something in, and your search results don’t always match what you are looking for, or it doesn’t actually work at all. There ar…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Suggested Courses

809 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