Posted By

dreamlusion on 09/04/08


Tagged


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

dantreacy
LeeRJohnson
Tyster


Use PowerShell to flatten your folders (batch rename)


 / Published in: Windows PowerShell
 

URL: http://dreamlusion.eucoding.com/doku.php?id=blog:2008:09:flatten_folders_batch_rename

This command will recursively move your *.jpg images into the current directory, and add the originally containing directory name as a prefix for the image file.

  1. (ls -r -include *.jpg) | % { mv -literal $_\3 $_\3.Name.Insert(0, [String]::Format("{0} - ", $_\3.Directory.Name))}

Report this snippet  

Comments

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

Link is dead...

You need to login to post a comment.