March 5, 2010

Powershell: Move files with the pipe

Filed under: Uncategorized — Kevmar @ 6:28 am

One of the games I play has a built in screen shot capture button. Every time you press it, a jpg gets saved into the screenshot folder. I have lots of files in this folder and its hard to manage. When I am taking screen shots for a blog post on another site, I will move all that I take that day to another folder. To day I broke out the powershell to do it for me. There are many ways to do this but I was playing with using the pipeline to do things tonight and I ended up with this command:

PS> ls C:\Program Files\World of Warcraft\Screenshots\*.jpg | sort-object lastwritetime | select -last 14 | move -Destination .\BlogFolder

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress