Windows bat遍历当前目录并修改文件后缀名

通过Windows bat遍历当前目录下的所有子目录,将其中所有后缀名为.mm的文件修改位.cpp:

@echo off

set DIR=%~dp0
set ROOT=%DIR%

for /f "delims=" %%f in ('dir  /b/a-d/s  %ROOT%\*.mm') do (

echo %%f
ren %%f *.cpp

)

pause

 

你可能感兴趣的:(Windows bat遍历当前目录并修改文件后缀名)