Monthly Archive

Categories

Removing Hidden files

I used the OneNote 2007 Side Note utility this morning and for some reason it created a table of contents file ( .onetoc2 ) file in each of the folders in which I keep my PowerShell. Strange behaviour.  Any way there are more of them than I want to delete by hand.

Get-ChildItem doesn’t show them – they are hidden files so we need to use

Get-ChildItem -Filter "*.onetoc2" -Force –Recurse

then we can pipe that into Remove-Item

Get-ChildItem -Filter "*.onetoc2" -Force -Recurse | Remove-Item –Force

again using the Force.  All gone.

And that young Luke is how you get rid of hidden files. Pity I didn’t post this on 4th May

Technorati Tags: PowerShell,Hidden Files

Leave a Reply