When you attempt to start the Windows Search (WSearch) service via the Services MMC, the following error may occur:
Windows could not start the Windows Search service on Local Computer Error 21: The device is not ready.
The result is the same when you run the net start wsearch command from a Command Prompt window. It returns the following error:
The Windows Search service could not be started. A system error has occurred. System error 21 has occurred. The device is not ready.
You may have tried running the Windows Search troubleshooter already.
Cause
This error occurs if the “DefaultApplicationsPath” or “TempPath” registry values point to a non-existent drive letter. A user on your computer may have redirected the Windows Search data folder to a removable (USB) drive and that drive letter (e.g., E:\ ) may now be unavailable.
In that case, the event log entries are created:
The Windows Search Service has failed to create the new search index. Internal error <1, 0x80070003, Failed to create application directory: E:\Search\Data\Applications>" will be created.
The Windows Search service terminated with the following error: The device is not ready.
Windows Search Error 21 can also happen if the Windows Search index database (Windows.edb) is locked. The error code 21 could also mean “ERROR_LOCK_VIOLATION” – The process cannot access the file because another process has locked a portion of the file.
Resolution
To resolve the Windows Search service error 21, follow the steps below:
Step 1: Fix the Windows Search folder paths in the registry
- Download AdvancedRun from Nirsoft.net and run it.
- Using AdvancedRun, start the Registry Editor (regedit.exe) as TrustedInstaller.
- In the Registry Editor, go to the following branch:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search\Gathering Manager
- Double-click DefaultApplicationsPath and set its data as follows:
%ProgramData%\Microsoft\Search\Data\Applications\
- Double-click TempPath and set its data as follows:
%ProgramData%\Microsoft\Search\Data\Temp\usgthrsvc
- Go to the following branch:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search
- Double-click DataDirectory and set its data as follows:
%ProgramData%\Microsoft\Search\Data\
- Double-click DefaultDataDirectory and set its data as follows:
%ProgramData%\Microsoft\Search\Data\
Important: Make sure the registry value type of the above values is REG_EXPAND_SZ. If the value is REG_SZ, delete it and create a new value of type REG_EXPAND_SZ. - Exit the Registry Editor.
Attempt to start the Windows Search service now. If the same error occurs, proceed to Step 2 below.
Step 2: Delete the Windows Search index database
Open Task Manager and kill searchindexer.exe if it exists. We need to delete or rename the file “Windows.edb” in the following folder:
C:\ProgramData\Microsoft\Search\Data\Applications\Windows\
Open admin Command Prompt and run the following commands:
sc config wsearch start= disabled net stop wsearch rd /s /q C:\ProgramData\Microsoft\Search\Data\Temp cd /d C:\ProgramData\Microsoft\Search\Data\Applications\Windows\ ren Projects Projects.old del windows.edb /a del windows.db /a reg add "HKLM\SOFTWARE\Microsoft\Windows Search" /v SetupCompletedSuccessfully /d 1 /t reg_dword /f sc config wsearch start= auto net start wsearch
This resets the Windows Search index.
See if you’re able to start the Windows Search service now.
One small request: If you liked this post, please share this?
One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!
Hi – no success:
1. Fix the Windows Search folder paths in the registry – there was nothing to fix, everything was as you specify.
2. There was no Windows.edb file in C:\ProgramData\Microsoft\Search\Data\Applications\Windows\
When I Open admin Command Prompt and run the specified commands it gives me:
The Windows Search service is starting.
The Windows Search service could not be started.
A system error has occurred.
System error 21 has occurred.
The device is not ready.
@George: Please run Process Monitor and share the PML log (zipped). See my post about Process Monitor here:
https://answers.microsoft.com/en-us/windows/forum/windows_10-performance/windows-could-not-start-the-windows-search-service/07f76b05-adcb-4c79-8ed0-3093832a7caf