I have many first level folders which contain variable layouts of files and sub folders. The first level folder names contain information I want to keep. For each folder I want
- a first level folder with the original name
- that has a subfolder called DATA
- with the rest of the contents of the folder moved into the DATA subfolder
Visually,
<top_folder><BR>
- <sub1><BR>
- <file1>, etc<BR>
Becomes
<top_folder>
- <DATA>
- <sub1>
- <file1>, etc
This batch file works except it becomes an infinite loop with the Move command.
for /D %%I in (*) do (
set CurrDirName="%%~nxI"
rename %CurrDirName% DATA
md %CurrDirName%
move DATA %CurrDirName%
)
I like DOS Move because it avoids waiting to copy data and then deleting. This could involved gigabytes of many files per top level folder. Can I avoid the infinite loop and still Move the folder?