Posted By

ericmorin21 on 04/16/09


Tagged

thumbsdb PowerShell


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

Vordreller
dantreacy
michanne
ringo380


Use Powershell to remove all instances of thumbs.db in current tree


 / Published in: Windows PowerShell
 

Powershell 1.0's Remove-Item recursion "doesn't work" according to the help, so you must find all instances with Get_ChildItem then pass the results to Remove-Item. Use th ecommented -"WhatIf" argument to determine what will be deleted before executing for real.

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

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Vordreller on April 16, 2009

Nice, works just like it should.

I made a similar post for batch, but this does the job more completely, as batch can't go into sub-sub-sub maps and powershell can.

You need to login to post a comment.