Questions tagged [taskkill]

Command line tool in Windows systems used to terminate tasks by process id (PID) or image name.

Useful links:

  1. TASKKILL on technet.
  2. TASKKILL on SS64 help pages.
280 questions
32
votes
5 answers

CMD what does /im (taskkill)?

I just read the following command: taskkill /f /im something.exe I read that /f forces the task to close, but what does /im do?
Hans Peter
  • 571
  • 1
  • 8
  • 14
28
votes
1 answer

how to kill a program by process name using cmd in windows 8?

it seems that whenever i open a program in windows 8, the process name is WWAHost.exe i would like to be able to do something like TASKKILL /F /IM notepad.exe and terminate a specific process by name if i kill WWAHost.exe then all open programs will…
Patrioticcow
  • 26,422
  • 75
  • 217
  • 337
24
votes
15 answers

Restarting explorer.exe only opens an explorer window

The Problem In one part of a batch file (kind of, see Extra Information) I need to restart Explorer, so I use the, tried-and-tested method of taskkill /f /im explorer.exe >nul explorer.exe Then this happens explorer.exe is successfully…
mythofechelon
  • 3,692
  • 11
  • 37
  • 48
17
votes
3 answers

Windows Batch file - taskkill if window title contains text

I want to write a simple batch file to kill a process that contains certain text in the window title. Right now I have: taskkill /fi "Windowtitle eq XXXX*" /im cmd.exe And that works, except what I want to do is use the wildcard both at the…
uesports135
  • 1,083
  • 2
  • 16
  • 25
17
votes
3 answers

windows batch command to determine working directory of a process

Why I ask is that my program uses 3rd party software that sometimes leaves behind orphan processes that have no link back to my program or the 3rd party process. These orphan processes start to add up and consume tons of resources over time. I…
user972276
  • 2,973
  • 9
  • 33
  • 46
15
votes
1 answer

What are exit codes from the taskkill utility?

In my MSI installer custom-action handler (done with C++) I cannot obtain the SE_DEBUG_NAME privilege to be able to open and terminate a process, thus I have to resort to doing it with the taskkill utility as such: taskkill /f /pid 1230 What I need…
c00000fd
  • 20,994
  • 29
  • 177
  • 400
14
votes
1 answer

Linux equivalent of taskkill

What is the Linux equivalent of this command? taskkill /F /IM myStupidProcess.exe /T
Müller
  • 973
  • 6
  • 19
  • 38
11
votes
2 answers

Close a running application from DOS command line

The start command can launch an application like notepad in a batch file like this: start notepad start "my love.mp3" But how do I close the running application from the command line? I found taskkill in my searches but I don't think that is the…
niko
  • 9,285
  • 27
  • 84
  • 131
11
votes
3 answers

taskkill doesn't kill process

I will sometimes get a process such that if I run taskkill /im the_process.exe /f /t, then it won't kill it, because: ERROR: The process with PID 6492 (child process of PID 5788) could not be terminated. Reason: There is no running instance of the…
Jeff M
  • 2,492
  • 3
  • 22
  • 38
10
votes
2 answers

Kill process before (re)install using "taskkill /f /im" in Inno Setup

I install a service/daemon, which needs to be killed before uninstall and reinstall. I already found out how to do it for uninstall: [UninstallRun] Filename: "taskkill"; Parameters: "/im ""My Service.exe"" /f"; Flags: runhidden The [Run] section,…
sashoalm
  • 75,001
  • 122
  • 434
  • 781
9
votes
2 answers

If Notepad.exe is running then taskkill if not running go to next statement

I need help writing batch code. In the initial state of my batch script I need to check if notepad.exe is running if it is running then taskkill /im notepad.exe elsif notepad.exe is not running then go to next batch statement/code.
Mowgli
  • 3,422
  • 21
  • 64
  • 88
8
votes
1 answer

Audio keeps playing after force close

First of all, thank you for this great site, I have found a great deal of information by searching through the questions answered here. I have a problem, though, that I only found one mention of (with no answer). I am writing an application that…
therealdm
  • 91
  • 1
  • 6
8
votes
5 answers

android task kill

I want to kill all tasks that run in android like task killer... What I have done until now is: ActivityManager manager = (ActivityManager) this.getSystemService(ACTIVITY_SERVICE); List activityes = ((ActivityManager)…
Cata
  • 11,133
  • 11
  • 65
  • 86
7
votes
2 answers

ActivityManager.killBackgroundProcesses different from "Force stop"

I was experimenting with ActivityManager.killBackgroundProcesses in my application and notice something interesting. I hope someone on stackoverflow can shed some light on this. So if I start an application, for example, youtube, I first see the…
Safecoder
  • 1,035
  • 2
  • 17
  • 32
6
votes
1 answer

Is taskkill safe to close a process?

I want to be able to close a process on a remote computer using a .bat file. eg: taskkill /im Myapp.exe Is using taskkill a suitable way to close an application? eg like clicking the 'X' on the toolbar? Does it give the app time to run all of it's…
nf313743
  • 4,129
  • 8
  • 48
  • 63
1
2 3
18 19