IT Knowledge Base

Technical Repository

HowTo: Powershell – Disable Drive Indexing

Create a file named Disable_Disk_Indexing.ps1 and copy and paste the following: 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:” Don’t forget to set […]

Read More