I am a novice creating batch files... I needed some expert help creating a batch file that creates a sequential, uniquely named subfolder... under each unique subfolder encountered in a given directory. I did not want the root or files within the folders to be modified... I just wanted the files to end up under a new, incremented folder... grouped by what subfolder they originally were in.
For example, given these folders/files:
C:\MainFld\MySubFldA\MyFile1.txt
C:\MainFld\MySubFldB\MyFile2.xls
C:\MainFld\MySubFldC\MySubSubFldA\MyFile3.doc
C:\MainFld\MySubFldC\MySubSubFldA\MyFile4.doc
C:\MainFld\MySubFldC\MySubSubFldB\MyFile5.mdb
C:\MainFld\MySubFldC\MySubSubFldB\MyFile6.mdb
I needed to have the folder structure changed to this:
C:\MainFld\MySubFldA\Fld1\MyFile1.txt
C:\MainFld\MySubFldB\Fld2\MyFile2.xls
C:\MainFld\MySubFldC\MySubSubFldA\Fld3\MyFile3.doc
C:\MainFld\MySubFldC\MySubSubFldA\Fld3\MyFile4.doc
C:\MainFld\MySubFldC\MySubSubFldB\Fld4\MyFile5.mdb
C:\MainFld\MySubFldC\MySubSubFldB\Fld4\MyFile6.mdb
Etc... for everything under C:\MyMainFld...
I also wanted the batch file to "remember" the last "Fld" number it left off with after a run. For example, after running once and going through all folders, it then sends the last "Fld" number used to a text or temp file... then if the batch file is run again in the future, it reads the temp file and starts the incrementing at that number.
Is this possible to create?? I thank you for your time and help in advance.
CK