I know I will be killed about this: Salmon Trout and billrich have a...."interesting" relationship. Don't think they did this for the first time....just a heads up.
getting back on topic...
Yes, let's.
The "dir /s" command will list every file in the directory the command is run in and in every sub-directory, sub-sub-directory etc (I think that's why it's an "s"), as you want it.
The "dir /b /s" will only list the names of the files. (see the difference the "b" switch does by trying the two different commands [without the "s" switch]).
Redirecting that output to a txt file works like this: "dir /b /s > myText.txt".
Then check out the for command. It is too long and complicated to explain quickly, but you can extract the info you need for now. What I think you need is "for /f %%x in (myText.txt) do ( ren %x% %x%.mpg)". The renaming part might not work. This might be because of "delayed expansion"...another long-ish topic that you can find a lot of information about
.
As for the 2-9 thing, if the number will always be before a hyphen('-') you can use the for command with the options "tokens=1 delims=-", then check (using an if statement) if it's between 2 and 9, and if so, add the '0'.
There is a lot of documentation out there that you can use to bring together this project of yours, go look for it
.
Hope this helps
Two-Eyes %
PS. do you strictly need a batch file solution? ghostdog is an experiences vbs programmer and most probably...(99.99%
)... his script is correct....