How to start / stop / pause search indexer in Windows

I would like to determine how to programmatically start / stop / pause the indexer from Microsoft Search.

I know this is possible because I have seen this in programs like this: http://brandontools.com/files/folders/sidebar_gadgets/entry511.aspx

However, I cannot find any documents on MSDN or anywhere.

There is a Windows Search service that can be managed using traditional service management methods. However, starting / stopping this service also changes the availability of the search itself. I want to control only the indexer.

Does anyone know where to find documents describing how to interact with the index? My search skills did not help me.

+4
source share
6 answers

It is not possible to simply disable the indexing part. Is it all or nothing to service. The WSearch service description reads:

"Provides content indexing and caching of properties for files, email, and other content (via the extensibility API). The service responds to file and email notifications for indexed modified content. If the service is stopped or disabled, Explorer will not be able to display virtual views "item folders, and a search in Explorer will return to a slow search on the items."

However, you can manage it using the disk / folder properties ... from Explorer, you can switch it for a separate disk (see disk properties, there is the option "enable indexing service ..." ") or for a folder (folder properties β†’ advanced β†’ "For a quick search, enable the indexing service ...").

EDIT ... a bit of a search query, and the following properties are available - if you look at the MSDN page for System.IO.FileAttributes , there is a NotContentIndexed property with a description. The file will not be indexed by the operating system content indexing service. I would suggest that you should install this in separate folders. I don’t know if this works if it is installed at the disk level (without recursively running through the disk), but I hope it gives you a start on everything that you end up trying to achieve.

+3
source

According to Microsoft, the official way to do this is not so.

+1
source

Something like that:

ServiceController service = new ServiceController ("WSearch");

service.Start ();

or

service.Stop ();

0
source

Here's a great tutorial on interacting programmatically with Windows Search: an article in JoyOfCode .

The Windows Search 3.x SDK provides a .NET API that works with Windows Search 3 or 4.

Unfortunately, this does not cause a pause / resume. All the index control patterns I found use WMI to stop the search service. Obviously, this will stop indexing, but due to the fact that the search itself is not available.

0
source

This is an old thread, but I came across it. Someone else might.

Use the AutoIT script to open the indexing options and click the Pause button in the dialog box.

0
source

Open the Run dialog box (Start | Run), type (or copy)% SystemRoot% \ system32 \ compmgmt.msc / s and expand the last

-one
source

All Articles