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.
Asked
Active
Viewed 723 times
1 Answers
2
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.

squillman
- 37,883
- 12
- 92
- 146
-
I tried this script. It keeps bombing out with an application exception in ntdll.dll – Kevin Sep 28 '09 at 18:42
-
-
Also, did you try just my code first or did you add it to something else to run? I don't get that error no matter what I change with my code. – squillman Sep 28 '09 at 18:53
-
XP. Only thing change was "MyServerName" "MyCatalog" and "c:\FolderToRescan" to reflect the specifics of the system – Kevin Sep 28 '09 at 19:22
-
Is the target system your XP machine or is it a remote host? If remote, what's its OS? – squillman Sep 28 '09 at 20:11
-
I am remote desktopped into a machine and executing locally there. It is xp as well – Kevin Oct 05 '09 at 13:11
-
-
-
Script about `MsIndexServer`: http://www.activexperts.com/network-monitor/scripts/powershell/msindexserver – Kiquenet Jun 22 '16 at 07:51