简单批处理for,重命名当前文件夹下某文件

@echo off

for /f %%i in ('dir /s /b "*.txt"') do (
ren "%%~pi%%~ni.txt" "%%~ni"

copy "%%~pi%%~ni.txt" "out\%%~ni.txt"
)

原文地址:https://www.cnblogs.com/hewei2012/p/2839905.html