Rename all files in all subfolders except some folders
Posted: 10 Apr 2021 06:10
Hello,
I want to rename all .txt files to .old in all subfolders of a main folder except for subfolders called "archive" and "new".
I see how to rename files in all subfolders but I don't know how to exclude some folders from the script.
Any help appreciated! 
I want to rename all .txt files to .old in all subfolders of a main folder except for subfolders called "archive" and "new".
I see how to rename files in all subfolders but I don't know how to exclude some folders from the script.
Code: Select all
For /R MainFolder\ %%G in (*.txt) do REN "%%G" "%%~nG.old"
