Networking HowTos
Networking HowTos

PowerShell Command to Recursively Delete Thumbs.db

July 12, 2012 Microsoft, PowerShell

The PowerShell command below can be used to remove thumbs.db files from the current folder, and all sub folders.
Make sure you change directory ‘cd’ into the folder you want the command to run from.

Get-ChildItem -Path . -Include Thumbs.db -Recurse -Name -Force | Remove-Item -Force

You can change the ‘-Include’ parameter to any wildcard you like, such as *.tmp or *.bak for example.

Get-ChildItem -Path . -Include *.tmp -Recurse -Name -Force | Remove-Item -Force

Remove the ‘Remove-Item’ statement to simply view a list of files without actually deleting them.

Get-ChildItem -Path . -Include Thumbs.db -Recurse -Name -Force

You Might Also Like