SearchHost.exe crashing - cant search

Coyo2

Member
Joined
Nov 22, 2023
Posts
11
This is driving me mad! I cant search via start menu, only using explorer. I have so many programs installed it's a nightmare...

I've tried sfc and dism a few times, plus the steps mentioned in posts such as this about restarting services, running that powershell command, etc. It's been like this for a few days, persisting across reboots.

This is the error I see in event viewer whenever I try to search:

Faulting application name: SearchHost.exe, version: 623.25401.80.0, time stamp: 0x652089e4
Faulting module name: Windows.UI.Xaml.dll, version: 10.0.22621.2715, time stamp: 0x981d05ca
Exception code: 0xc000027b
Fault offset: 0x0000000000577db2
Faulting process id: 0x0x4AD4
Faulting application start time: 0x0x1DA1DB5E2148ED2
Faulting application path: C:\Windows\SystemApps\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\SearchHost.exe
Faulting module path: C:\Windows\System32\Windows.UI.Xaml.dll
Report Id: b6c9f5ed-ccf6-4855-bd35-a6ba0b82b7e9
Faulting package full name: MicrosoftWindows.Client.CBS_1000.22677.1000.0_x64__cw5n1h2txyewy
Faulting package-relative application ID: CortanaUI

Assistance would be greatly appreciated. Thanks!
 
Open a command prompt as an administrator and run these commands:

dism /online /cleanup-image /restorehealth
sfc /scannow


See if that helps.
 
Re-register the apps
  • Right click on the Start button and select Terminal (Administrator).
  • Now type the following in the command and hit Enter:
    • Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
  • Restart the PC.
 
For the single install, I would run the following:

Add-AppxPackage -ForceApplicationShutdown -DisableDevelopmentMode -Register "$((Get-AppxPackage MicrosoftWindows.Client.CBS).InstallLocation)\AppxManifest.xml"
 
  • Highlight the entire content of the quote box below.
# Copyright © 2019, Microsoft Corporation. All rights reserved.

function T-R
{
[CmdletBinding()]
Param(
[String] $n
)

$o = Get-Item -LiteralPath $n -ErrorAction SilentlyContinue
return ($o -ne $null)
}

function R-R
{
[CmdletBinding()]
Param(
[String] $l
)

$m = T-R $l
if ($m) {
Remove-Item -Path $l -Recurse -ErrorAction SilentlyContinue
}
}

function S-D {
R-R "HKLM:\SOFTWARE\Microsoft\Cortana\Testability"
R-R "HKLM:\SOFTWARE\Microsoft\Search\Testability"
}

function K-P {
[CmdletBinding()]
Param(
[String] $g
)

$h = Get-Process $g -ErrorAction SilentlyContinue

$i = $(get-date).AddSeconds(2)
$k = $(get-date)

while ((($i - $k) -gt 0) -and $h) {
$k = $(get-date)

$h = Get-Process $g -ErrorAction SilentlyContinue
if ($h) {
$h.CloseMainWindow() | Out-Null
Stop-Process -Id $h.Id -Force
}

$h = Get-Process $g -ErrorAction SilentlyContinue
}
}

function D-FF {
[CmdletBinding()]
Param(
[string[]] $e
)

foreach ($f in $e) {
if (Test-Path -Path $f) {
Remove-Item -Recurse -Force $f -ErrorAction SilentlyContinue
}
}
}

function D-W {

$d = @("$Env:localappdata\Packages\Microsoft.Cortana_8wekyb3d8bbwe\AC\AppCache",
"$Env:localappdata\Packages\Microsoft.Cortana_8wekyb3d8bbwe\AC\INetCache",
"$Env:localappdata\Packages\Microsoft.Cortana_8wekyb3d8bbwe\AC\INetCookies",
"$Env:localappdata\Packages\Microsoft.Cortana_8wekyb3d8bbwe\AC\INetHistory",
"$Env:localappdata\Packages\Microsoft.Windows.Cortana_cw5n1h2txyewy\AC\AppCache",
"$Env:localappdata\Packages\Microsoft.Windows.Cortana_cw5n1h2txyewy\AC\INetCache",
"$Env:localappdata\Packages\Microsoft.Windows.Cortana_cw5n1h2txyewy\AC\INetCookies",
"$Env:localappdata\Packages\Microsoft.Windows.Cortana_cw5n1h2txyewy\AC\INetHistory",
"$Env:localappdata\Packages\Microsoft.Search_8wekyb3d8bbwe\AC\AppCache",
"$Env:localappdata\Packages\Microsoft.Search_8wekyb3d8bbwe\AC\INetCache",
"$Env:localappdata\Packages\Microsoft.Search_8wekyb3d8bbwe\AC\INetCookies",
"$Env:localappdata\Packages\Microsoft.Search_8wekyb3d8bbwe\AC\INetHistory",
"$Env:localappdata\Packages\Microsoft.Windows.Search_cw5n1h2txyewy\AC\AppCache",
"$Env:localappdata\Packages\Microsoft.Windows.Search_cw5n1h2txyewy\AC\INetCache",
"$Env:localappdata\Packages\Microsoft.Windows.Search_cw5n1h2txyewy\AC\INetCookies",
"$Env:localappdata\Packages\Microsoft.Windows.Search_cw5n1h2txyewy\AC\INetHistory")

D-FF $d
}

function R-L {
[CmdletBinding()]
Param(
[String] $c
)

K-P $c 2>&1 | out-null
D-W # 2>&1 | out-null
K-P $c 2>&1 | out-null

Start-Sleep -s 5
}

function D-E {
Write-Host "Press any key to continue..."
$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp") > $null
}

Write-Output "Verifying that the script is running elevated"
if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
if ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) {
$Cx = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList "-noexit",$Cx
Exit
}
}

$a = "searchui"
$b = "$Env:localappdata\Packages\Microsoft.Windows.Search_cw5n1h2txyewy"
if (Test-Path -Path $b) {
$a = "searchapp"
}


Write-Output "Resetting Windows Search Box"
S-D 2>&1 | out-null
R-L $a

Write-Output "Done..."
D-E
  • Right click on the highlighted text and select Copy.
  • Right click on the Start button and select Terminal (Administrator)
  • A Command prompt will popup
  • Right click on the command prompt and the contents of the clipboard will be pasted therein.
  • Press Enter.
  • After completing the script, restart and test.
 
Ran it twice with restarts, did not work. I mean the script ran without errors but the problem is not repaired.
 
Thank you, that is what I figured would probably need to happen at this point. I need to upgrade some hardware this weekend so I will do so after I have upgraded.
 

Has Sysnative Forums helped you? Please consider donating to help us support the site!

Back
Top