STUART BLACKLER

A twenty-something software developer based in the UK

25th March 2012

Resetting the Windows Search service to default in PowerShell

Every now and then I like to try and improve the performance and usability of my machines. My latest exploit has been to attempt to improve the search to include a few custom locations into the indexes. I accidently removed too much and it has left me with a broken search facility. After a quick google, I found a website to reset the service: http://brandonlive.com/2007/04/20/faq-how-to-completely-reset-wds-windows-search/

I didn't want to have to go through the regedit way manually, so I decided to use powershell (built into Windows 7. Start > Accessories > Windows PowerShell > Powershell (Run As Admin)). Here is the resulting script

# set the path so we don't have to type it again, this can be used to test if you want
$path = "HKLM:\Software\Microsoft\Windows Search"

# Reset the Windows Search Key
set-itemproperty -path $path -name "SetupCompletedSuccessfully" -value 0

# Restart the Windows Search
Restart-Service wsearch

Which can also be downloaded from the following link: http://dl.dropbox.com/u/12121071/powershell/Reset_Windows_Search.ps1

Hopefully this will get someone else out of the black hole that I was also in :)

Update (25/03/12): This will only reset the locations that Windows Search will index, not fix anything else (That I am aware of)

Comments (0)

Leave a comment...