Disable drive indexing for specific folders

This topic contains 1 reply, has 2 voices, and was last updated by  Dan Potter 2 years, 1 month ago.

  • Author
  • #34732


    Is it possible to disable drive indexing for specific folders instead of the entire drive?

    I found the following script, but not sure if it can be used to disable indexing on a certain folder.

    function Disable-Indexing {
        $obj = Get-WmiObject -Class Win32_Volume -Filter "DriveLetter='$Drive'"
        $indexing = $obj.IndexingEnabled
        if("$indexing" -eq $True){
            write-host "Disabling indexing of drive $Drive"
            $obj | Set-WmiInstance -Arguments @{IndexingEnabled=$False} | Out-Null
    #Disable Drive Indexing on C:\
    Disable-Indexing "C:"

    What I really want to do (from a GUI perspective) is go to Indexing Options > Highlight users folder and select "modify" > expand the users folder and personal folder and de-select a specific folder. I would also like to exclude Appdata. Any ideas how to automate this for all users on a PC?

  • #34735

    Dan Potter

    Check out the keys under hklm\software\microsoft\windows searc\crawlscopemanager.


You must be logged in to reply to this topic.