<p>Every time I turn on my company-owned development machine, I have to kill 10+ processes using the Task Manager or any other process management app just to get decent performance out of my IDE.  Yes, these are processes from programs that my company installs on my machine for security and compliance. What I'd like to do is have a .bat file or script of some kind with which I can kill the processes in question.  </p>

<p>Does anybody know how to do this?</p>

[{'answer_id': 33826, 'author': 'Shog9', 'author_id': 811, 'author_profile': 'https://Stackoverflow.com/users/811', 'pm_score': 2, 'selected': False, 'text': '<p>Download <a href="http://technet.microsoft.com/en-us/sysinternals/bb896683.aspx" rel="nofollow noreferrer">PSKill</a>. Write a batch file that calls it for each process you want dead, passing in the name of the process for each.</p>\n'}, {'answer_id': 33828, 'author': 'DevelopingChris', 'author_id': 1220, 'author_profile': 'https://Stackoverflow.com/users/1220', 'pm_score': 7, 'selected': False, 'text': '<pre><code>taskkill /f /im "devenv.exe"\n</code></pre>\n\n<p>this will forcibly kill the pid with the exe name "devenv.exe"</p>\n\n<p>equivalent to -9 on the nix\'y kill command</p>\n'}, {'answer_id': 33831, 'author': 'Factor Mystic', 'author_id': 1569, 'author_profile': 'https://Stackoverflow.com/users/1569', 'pm_score': 9, 'selected': True, 'text': '<p>You can do this with \'<strong>taskkill</strong>\'.\nWith the /IM parameter, you can specify image names. </p>\n\n<p>Example:</p>\n\n<pre><code>taskkill /im somecorporateprocess.exe\n</code></pre>\n\n<p>You can also do this to \'<strong>force</strong>\' kill:</p>\n\n<p>Example:</p>\n\n<pre><code>taskkill /f /im somecorporateprocess.exe\n</code></pre>\n\n<p>Just add one line per process you want to kill, save it as a .bat file, and add in your startup directory. Problem solved!</p>\n\n<p>If this is a legacy system, <a href="http://technet.microsoft.com/en-us/sysinternals/bb896683.aspx" rel="noreferrer">PsKill</a> will do the same.</p>\n'}, {'answer_id': 33859, 'author': 'slipsec', 'author_id': 1635, 'author_profile': 'https://Stackoverflow.com/users/1635', 'pm_score': 1, 'selected': False, 'text': '<p>Use Powershell!  Built in cmdlets for managing processes.  <a href="http://blogs.msdn.com/powershell/archive/2007/01/16/managing-processes-in-powershell.aspx" rel="nofollow noreferrer">Examples here</a> (hard way), <a href="http://www.computerperformance.co.uk/powershell/powershell_process.htm" rel="nofollow noreferrer">here</a>(built in) and <a href="http://www.computerperformance.co.uk/powershell/powershell_process_stop.htm" rel="nofollow noreferrer">here</a> (more).</p>\n'}, {'answer_id': 33912, 'author': 'Jason Z', 'author_id': 2470, 'author_profile': 'https://Stackoverflow.com/users/2470', 'pm_score': 3, 'selected': False, 'text': "<p>I'm assuming as a developer, you have some degree of administrative control over your machine.  If so, from the command line, run msconfig.exe.  You can remove many processes from even starting, thereby eliminating the need to kill them with the above mentioned solutions.</p>\n"}, {'answer_id': 33920, 'author': 'Brian Stewart', 'author_id': 3114, 'author_profile': 'https://Stackoverflow.com/users/3114', 'pm_score': 3, 'selected': False, 'text': '<p>Get <a href="http://technet.microsoft.com/en-us/sysinternals/bb963902.aspx" rel="noreferrer">Autoruns</a> from Mark Russinovich, the Sysinternals guy that discovered the Sony Rootkit... Best software I\'ve ever used for cleaning up things that get started automatically.</p>\n'}, {'answer_id': 28273570, 'author': 'npocmaka', 'author_id': 388389, 'author_profile': 'https://Stackoverflow.com/users/388389', 'pm_score': 3, 'selected': False, 'text': '<p>As TASKKILL might be unavailable on some Home/basic editions of windows here some alternatives:</p>\n\n<pre><code>TSKILL processName\n</code></pre>\n\n<p>or</p>\n\n<pre><code>TSKILL PID\n</code></pre>\n\n<p>Have on mind that <code>processName</code> should not have the <code>.exe</code> suffix and is limited to 18 characters.</p>\n\n<p>Another option is <code>WMIC</code> :</p>\n\n<pre><code>wmic Path win32_process Where "Caption Like \'MyProcess%.exe\'" Call Terminate\n</code></pre>\n\n<p>wmic offer even more flexibility than taskkill with its SQL-like matchers .With <code>wmic Path win32_process get</code> you can see the available fileds you can filter (and <code>%</code> can be used as a wildcard). </p>\n'}, {'answer_id': 40262412, 'author': 'Sarath Subramanian', 'author_id': 3312636, 'author_profile': 'https://Stackoverflow.com/users/3312636', 'pm_score': 1, 'selected': False, 'text': '<p>Please find the below logic where it works on the condition.</p>\n\n<p>If we simply call <code>taskkill /im applicationname.exe</code>, it will kill only if this process is running. If this process is not running, it will throw an error.</p>\n\n<p>So as to check before <code>takskill</code> is called, a check can be done to make sure  execute <code>taskkill</code> will be executed only if the process is running, so that it won\'t throw error.</p>\n\n<pre><code>tasklist /fi "imagename eq applicationname.exe" |find ":" &gt; nul\n\nif errorlevel 1 taskkill /f /im "applicationname.exe"\n</code></pre>\n'}, {'answer_id': 48756190, 'author': 'Eduard Florinescu', 'author_id': 1577343, 'author_profile': 'https://Stackoverflow.com/users/1577343', 'pm_score': 1, 'selected': False, 'text': '<p>Here I wrote an example command that you can paste in your <code>cmd</code> command line prompt and is written for <code>chrome.exe</code>. </p>\n\n<pre><code>FOR /F "tokens=2 delims= " %P IN (\'tasklist /FO Table /M "chrome*" /NH\') DO (TASKKILL /PID %P)\n</code></pre>\n\n<p>The for just takes all the <code>PID</code>s listed on the below <code>tasklist</code> command and executes <code>TASKKILL /PID</code> on every <code>PID</code> </p>\n\n<pre><code>tasklist /FO Table /M "chrome*" /NH\n</code></pre>\n\n<p>If you use the for in a batch file just use %%P instead of %P</p>\n'}]
['https://Stackoverflow.com/questions/33822', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3030/']