Slumming with the Windows Command Intepreter
Yesterday marked my brief foray into the funky little world of the Windows command line. Not a place I’d usually be programming, but I had a really specific problem and it seemed like I should be able to whip up a sol’n there without a ton of wasted work.
Here’s the deal: usually when I download digital albums, all the tracks are named in the form <Bandname> – <Songname>.wma. I just don’t like the band name being in the file name, since I’m already organizing tracks by band & album folders. I end up spending a couple of minutes in Explorer renaming tracks manually: start at the top of the listing, hit F2, CTRL-Left Arrow a few times until everything but the band name & hyphen prefix is selected, hit enter, down arrow, rinse & repeat.
Not the end of the world. But like any geek, I’d rather spend five hours once solving a programming problem (and maybe learning something in the process) than spend fifteen minutes every week executing a mindlessly repetitive manual task. And I just picked up a couple of anthologies with over 80 tracks a piece — that’s critical mass, baby.
Initially I thought I’d whip up a little EXE in C or VB or something (Flash not being suited to this kind of local file I/O) that snarfed a directory listing, automatically figured out the prefix (if any) that all file names had in common, and renamed all the files to eliminate that prefix. But then I wondered how far I could get with just a simple batch file. The answer: close enough. No automatic detection, but a decent little utility to walk through a folder hierarchy recursively and strip a specified string out of all music filenames in there. Potentially boring technical details follow, so only click the “more>>” link if that’s your bag…
Posted in Technobabble having Comments Off on Slumming with the Windows Command Intepreter