@echo off
for /f %%i in ('dir /s /b "*.txt"') do (
ren "%%~pi%%~ni.txt" "%%~ni"
copy "%%~pi%%~ni.txt" "out\%%~ni.txt"
)
@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/archive/2012/12/30/2839905.html