views:

127

answers:

1

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!

A: 
Frank Bollack
Frank,Thanks so much for this! I did not use the exact code you have written though I used the most part of it and it has helped alot!Very useful, thank you so much for taking the time to write this up for me, it's very much appreciated.
Ser1esII
You are welcome. If you think an answer solves your problem or is useful to you, it is a good habbit to accept it (mark the chekbox below the title).
Frank Bollack