r/usefulscripts • u/falcon5nz • Dec 05 '17
How do I use a batch file to create a folder in each subfolder with the name based on the level of the subfolder
My boss has decided to create a folder in each folder level on our server to designate what level it is from the base folder, so _A will be the first folder level, _B will be the second level, _C the third and so on as shown below
C:\Stuff
C:\Things
C:_Level A
C:\Stuff\Things
C:\Stuff_Level B
C:\Stuff\Things\More Things
C:\Stuff\Things_Level C
C:\Stuff\Things\More Things_Level D
C:\Things\Things
C:\Level B
C:\Things\Things\More Things
C:\Things\Things_Level C
C:\Things\Things\More Things_Level D
For what its worth I don't think its a great idea but it not my call. What annoyed me was watching one of our office staff doing this manually. I asked if it could wait a day or to while I figure out a more efficient way of doing it.
I'm sure there'll be a way to do it with a batch file but I can't figure it out.
Can anyone give me some direction.
Edit:- I've just been told we only need to go down 4 levels, so down to C:/Stuff/Things/More Stuff.