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

 
Participant
3 years, 2 months ago.

  • Author
    Posts
  • #34732

    Participant
    Topics: 30
    Replies: 41
    Points: 32
    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 {
        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

    Participant
    Topics: 17
    Replies: 573
    Points: 21
    Rank: Member

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

    also.

    Powershell Tackles Windows Desktop Search

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

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort