Moving and renaming files, keeping extension but include sub directories in batch file

Posted by Ser1esII on Stack Overflow See other posts from Stack Overflow or by Ser1esII
Published on 2010-05-30T13:59:14Z Indexed on 2010/05/30 14:02 UTC
Read the original article Hit count: 211

Filed under:
|
|
|
|

Forgive me if this is nor the place to ask these questions, I am new to batch and scripts and a bit new to these kind of posts...

I have a folder that will receive files and folders, I want to run a script that looks at the directory and renames all files in each subfolder numerically, and moves them if possible.

For example I have something that looks like the following

Recieved_File_Folder
     |_folder1
     | |_file1.txt
     | |_file2.bmp
     |_folder2
     | |_file4.exe
     | |_file5.bmp
     |__file9.txt
     |__file10.jpg

I would like to be able to look in every directory and move it to something like this, keeping in mind the names of the files will be random and I want to keep the extension intact also.

Renamed_Folder
    |_folder1
    | |_1.txt
    | |_2.bmp
    |_folder2
    | |_1.exe
    | |_2.bmp
    |__1.txt
    |__2.jpg

I have spent alot of time on this and am not doing too well with it, any help would be very greatly appreciated!! Thank you in advance!

© Stack Overflow or respective owner

Related posts about batch

Related posts about rename