Return to Snippet

Revision: 8142
at September 4, 2008 10:33 by dreamlusion


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

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

Initial Description
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.

Initial Title
Use PowerShell to flatten your folders (batch rename)

Initial Tags


Initial Language
Windows PowerShell