Encountered a problem. I have many subdirectories, such as ab001, ab005, ab113... Under the ab001 directory, there is ha0001_00_00.txt, under the ab005 directory, there is ha0012_00_00.txt, under the ab113 directory, there is ha0025_00_00.txt,... I want to implement this function and change the files in each directory to the format of ha????_02_00.txt, that is, change the last few digits of the main file name from _00_00 to _02_00. I used the following command to modify it, but it didn't work. It seems that adding %var:~n,m% doesn't work. for /f "delims=" %a in ('dir /s /b /a-d D:\DOS\ren\ha????_00_00.txt') do echo ren "%a" "%~na.txt" Ask experts, how to modify it? Or is there any other method?


