How to fix problems with Windows Search

When Windows search isn't working properly, you can reset the search function with a PowerShell script from Microsoft.

Note: This script only works on Windows 10 1903 and later versions. (It is not recommended to use this script on systems with Windows 11).

Download ResetWindowsSearchBox.ps1 from the Microsoft Website to your desktop.
  • You must have administrator privileges to run this PowerShell script.
  • Right-click ResetWindowsSearchBox.ps1 and select the option: Run with PowerShell.
  • When the following message appears, please press Y to allow this script to be executed.

Windows-Search-Power-Shell.png


  • When the script is executed successfully, you can close this window.

When this message appears, you must change the execution policy settings first in order to run the script.

Code:
File C:\Users\<username>\Desktop\ResetWindowsSearchBox.ps1 cannot be loaded because running scripts is disabled on this
system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
    + CategoryInfo          : SecurityError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnauthorizedAccess

Windows-Search-Power-Shell-2.png


Change execution policy settings
  • To change the execution policy settings in Windows you can use the following commands.
    1. Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted - Use this command to allow scripts to run.
    2. Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Restricted - Use this command to restore the original execution policy setting afterwards.
  • Another option is to run the script by using the "Bypass" flag.

  • Right-click the start button and select the option: Windows PowerShell (Admin).
  • To navigate to your desktop, you can use cd $home and then sl desktop.

  • To run ResetWindowsSearchBox.ps1 with the "Bypass" flag you can use the following command.
    Code:
    PowerShell.exe -ExecutionPolicy Bypass -File .\ResetWindowsSearchBox.ps1

Windows-Search-Power-Shell-3.png


You can use this PowerShell script with the "Bypass" flag in the regular command prompt as well. However, you need another command to run this script.

Code:
Powershell.exe -ExecutionPolicy Bypass -File "%userprofile%\desktop\ResetWindowsSearchBox.ps1"

Windows-Search-Command-Prompt.png
 
Last edited:

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

Back
Top