Archive for the 'CLI' Category
So… The windows command line has a bunch of commands built in for common tasks such as creating directories, renaming stuff, moving things about, yada yada yada. Its kind of stunted though when I compare it to the kind of file operations I do all the time in my development work.
I just finished sorting a huge number of files into appropriate directories, and noticed annoyingly that about 10,000 files (images in this case) had signatures in the file name making them ugly when displayed on my HTPC as a slide show. For example “Blue Iris (!downloaded from precariouspanther.net!)”… (The site link obviously changed in this case). Rather than having that garbage show up on my screen, I much prefer it to just be “Blue Iris”.
The easiest way to do this is just selecting the file, pressing F2 (or right click/rename) and editing the name removing out the garbage. This is normally fine - however with this collection of around 10,000 images it would take, oh I dunno… three years???
Frell that for a joke! After five mins scouring google I didn’t find a quick and easy solution, so whipped up a quick php script to enable simple find/replace on file names in a directory, opened up trusty CMD, typed in
findReplaceName * ” (!downloaded from precariouspanther.net!)” “”
and within 2 minutes all the work is done. I used to use perl for my shell scripting in linux all the time on the web servers, but given I’m coding php all day every day (and setting up perl on windows is annoying) this worked out much much better for me.
read comments (0)

