Possible Duplicate:
How do I rename a bunch of files in the Command Prompt?
I'm coming back to Windows after several years in Linux (I'm a trucker, and the company I just leased my truck to, has features on their load board site that only work in IE, and only with compatibility mode turned on).
I also listen to a lot of audio books. I rip them from CD and download them from Audible, so I get a nice long list of MP3 files. Most of them have names like "Chapter 3 - Into the Void". But my truck stereo, which will play MP3 files on a USB flash drive, will only sort on about the first four characters of the filename. A list of 39 MP3's with filenames that all start with "Chapter" will be played back in random order. So I need to rename these files to something that starts with, say, a 2 or 3 digit number.
In Linux, I did this in a bash script to accomplish this:
#!/bin/bash
i=1
for file in *.mp3
do
j=$( printf "%03" "$i" )
mv "$file" "$j.mp3"
(( i++ ))
done
This would get me a directory of files named 00l.mp3, 002.mp3, 003.mp3, and so forth. But don't know how to do this in Windows.
I vaguely remember being able to do something using batch files in Windows, but the syntax is all different and the available tools to call forth are different (there is no sed or awk in Windows, unfortunately). Does anyone know where to point me to find this stuff out?
Thanks@