21

SearchIndexer.exe is preventing my device, which actually is my external hard drive, to be stopped.

I tried to close this application by looking up onto Task Manager, but couldn't find it on Processes tab.

Can I look up this process by name, get the process ID, and kill it?

4
  • 1
    Did you try with Process Explorer?
    – simlev
    Commented Jul 20, 2017 at 13:54
  • No, I don't find SearchIndexer.exe in the Disk tab, under the Processes with Disk Activity. Commented Jul 20, 2017 at 14:11
  • 1
    Well, I'm suggesting you try with a different tool called Process Explorer.
    – simlev
    Commented Jul 20, 2017 at 14:30
  • run control panel and exclude your external HDD from search index Commented Jul 20, 2017 at 14:46

2 Answers 2

28

If you're looking for processes such as SearchIndexer - this should be pretty simple to do with PowerShell

Get-Process will show you a list of running processes. In this case, I have piped it to Select -first 1 because you're interested in the column headers, not a list of the 100+ processes on my PC:enter image description here


Next up - now you know how to get processes, you need to narrow this down to a specific process. Below, I've shown 4 methods to do this: enter image description here Get-Process Search* will return all processes starting with search

Get-Process SearchIndexer will return just that one process if it exists

Get-Process | Where {$_.Name -eq "SearchIndexer"} will find all processes and then only select the one called SearchIndexer

Get-Process | Where {$_.ProcessName -Like "SearchIn*"} will get all processes and narrow down to ones that start with "SearchIn".

As a side note - you can use wild cards at either end, so `rchInde" will also return the process you want.


Now - to kill the process - pipe it to Stop-Process: enter image description here ..But it didnt work!


To Stop it - as with some processes - you need to run PowerShell as an Administrator: enter image description here ..but you still get a prompt!

...ignore the error at the bottom, we've just proven that the process doesn't exist any more

Add the -Force switch and the prompt goes away! enter image description here


But we dont like errors when we try to do it over and over: enter image description here ...so we need to handle it slightly differently. Instead of explicitly stopping that one process, grab all of them, filter it down to the ones we want (if any) and then kill them (if they exist): enter image description here


last up - add it as a scheduled task action (if you need to) as windows likes to restart certain services/processes and you're all set.

2
  • Thank you for the answer. You saved me! But OMG! Why can't windows just have a ps aux | grep ... :) Commented Jun 29, 2022 at 14:56
  • Thanks for this insight. Following it I was able to get my work done. Also, this command works for photos app : " C:\Windows>taskkill /F /IM PhotosApp.exe /T SUCCESS: The process with PID 168424 (child process of PID 2516) has been terminated." Commented May 9 at 15:23
2

An alternative to Get-Process:

Get-WmiObject Win32_Process | select commandline | Select-String -Pattern "SearchIndexer"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .