Rescanning specific folders with Windows Indexing service

I need to know if there is a way I can automate rescanning certain folders within Windows Indexing Service. Possibly through a batch file or something like that. I have several hundred folders that need to be rescanned and I don’t feel like manually right clicking and hitting rescan on each one.

Answer

Here’s a VBS script that should work for you. You could put this in a loop over your folder names.

Set objISAdm = CreateObject("Microsoft.ISAdm")
objISAdm.MachineName="MyServerName"
Set objCatAdm = objISAdm.GetCatalogByName("MyCatalog")
Set objScopeAdm = objCatAdm.GetScopeByPath("c:\FolderToReScan")
objScopeAdm.Rescan("TRUE")

In the last line, TRUE means do a full scan. Change it to FALSE to do an incremental scan.

Here’s a good source for Indexing Service script samples.

Attribution
Source : Link , Question Author : Kevin , Answer Author : squillman

Leave a Comment