@echo off setlocal enabledelayedexpansion

rem 获取当前文件夹名存入path变量中 for %%i in (.) do set 'path=%%~ni'

rem 遍历当前文件夹下的文本文件,重命名为path变量 for %%i in (*.txt) do ( set 'fileName=%%~ni' ren '%%i' '!path!.txt' )

echo 文件已经成功重命名! pause>nul

使用批处理命令重命名文件夹内文本文件

原文地址: https://www.cveoy.top/t/topic/nLwU 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录