I have a batch file that will compare D:\users\classes sub-folder with D:\users\children sub-folder's and if the name matches it will move all the sub-folders and files over from children to classes. eg. d:\users\children\1b\aidan.chan and d:\users\classes\1b\aidan.chan. all sub-folders and files from the children aidan.chan will move to classes aidian.chan.
if exist test del test
for /f "tokens=4,5 delims=\" %%a in ('dir /b /s /ad d:\users\classes') do if not "%%b" == "" (
for /f "tokens=4,5 delims=\" %%m in ('dir /b /s /ad d:\users\children') do if not "%%n" == "" (
if /i %%b equ %%n (
>>test echo d:\users\children\%%m\%%n will be copied to: d:\users\classes\%%a\%%b. All subdirectories incl.
>>test robocopy /MOV /S /R:1 d:\users\children\%%m\%%n d:\users\classes\%%a\%%b
But now the folder name of all these children will change and I will have a spreadsheet with their new folders name. eg. adian.chan folder will be 16chan10.
I will need to move all his data and sub-folders from D:\users\classes\1b\adian.chan over to D:\users\class2014\1b\16chan10
Can anyone help me to modify the batch file to do this please, much appreciated since I am not a programmer. Thanks in advance.