Disable drive indexing for specific folders

Welcome Forums General PowerShell Q&A Disable drive indexing for specific folders

This topic contains 1 reply, has 2 voices, and was last updated by

2 years, 11 months ago.

  • Author
  • #34732

    Points: 18
    Rank: Member

    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

    Points: 21
    Rank: Member

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


    Powershell Tackles Windows Desktop Search

The topic ‘Disable drive indexing for specific folders’ is closed to new replies.