Disable drive indexing for specific folders

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Dan Potter Dan Potter 10 months, 1 week ago.

  • Author
    Posts
  • #34732
    Profile photo of Jeff
    Jeff
    Participant

    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 {
        Param($Drive)
        $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
        }
    }
    
    #Use:
    #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
    Profile photo of Dan Potter
    Dan Potter
    Participant

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

    also.

You must be logged in to reply to this topic.