Friday, October 9, 2015

Flatten windows directory structure

My car stereo system allows for playing mp3 files off of a USB stick. When mp3s are in subfolders, it makes it difficult to jump songs predictably. Easiest way around it is to flatten all mp3s under a single folder.

I found this post describing how to use powershell to do it. Here is what I'm using for my own reference:

(ls -r -include *.mp3) | % { mv -literal $_ $_.Name}