# Disable drive indexing for specific folders

**URL:** <https://forums.powershell.org/t/disable-drive-indexing-for-specific-folders/5672>\
**Category:** PowerShell Help\
**Created:** [February 2, 2016, 2:43am UTC](https://forums.powershell.org/t/disable-drive-indexing-for-specific-folders/5672 "2016-02-02T02:43:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff-toy](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@jeff-toy](https://forums.powershell.org/u/jeff-toy)\
**Post date:** [February 2, 2016, 2:43am UTC](https://forums.powershell.org/t/disable-drive-indexing-for-specific-folders/5672/1 "2016-02-02T02:43:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dan-potter](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/dan-potter/32/138_2.png) [@dan-potter](https://forums.powershell.org/u/dan-potter)\
**Post date:** [February 2, 2016, 3:22am UTC](https://forums.powershell.org/t/disable-drive-indexing-for-specific-folders/5672/2 "2016-02-02T03:22:53Z")

</div>

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

also.

> **[Powershell Tackles Windows Desktop Search](https://powertoe.wordpress.com/2010/05/17/powershell-tackles-windows-desktop-search/)**
>
> A great question was posed in the Microsoft Powershell forum, “In PowerShell, which command should I use to know the directories currently included and excluded from the indexed system of Win…

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:42pm UTC](https://forums.powershell.org/t/disable-drive-indexing-for-specific-folders/5672/3 "2024-05-16T20:42:59Z")

</div>

Closed on May 16, 2024, 8:42pm UTC


