Replace the specified string in the folder name for batch processing. Replace the string
@ Echo off & color 3a & set c = 0123456789 abcdefghijklmnopqrstuvwxyz
Batch replacement of file (folder) names by title
Echo.
Echo this batch can replace the file names of all files in the folder where this file is located in batches.
Echo.
Echo. & set/p strtemp1 = enter the name string of the file (folder) to be replaced (spaces can be replaced ):
Echo. & set/p strtemp2 = enter the string of the replaced file (folder) name (Press enter to delete the string ):
For/f "delims =" % I in ('dir/s/B ') do (
Setlocal enabledelayedexpansion
Set "f = % ~ Nxi"
Set "f1 =! F: % strtemp1 % = % strtemp2 %! "
If not "% I" = % 0 (
If not "! F! "= "! F1! "(
If exist "! F1! "(
Echo because! F1! The same name exists ,! F! File name not changed) else ren "! F! ""! F1! "
)
Endlocal
)
)