DOS工具: 当前目录文件重命名并找到最新的复制到指定目录

@ECHO OFF
rem -- =============================================
rem -- DESCRIPTION: <自動_REN©>
rem -- AUTHOR:  <>
rem -- CREATE DATE: <2011/01/30>
rem -- =============================================
FOR /R %%L IN (*.MP3) DO (
IF %%~ZL GEQ 0 (CALL :NEXT_DO_REN "%%~NXL" %%~TL)
)

GOTO GO_COPY
:NEXT_DO_REN
@SET KK=%2
@SET YY=%KK:~0,4%
@SET MM=%KK:~5,2%
@SET DD=%KK:~8,2%
@SET WW=%3
@SET HHH=%WW:~0,2%
@SET MMM=%WW:~3,4%
@REN %1 NHK_%YY%%MM%%DD%_%HHH%%MMM%.MP3
GOTO END

:GO_COPY
@FOR /F "EOL=; TOKENS=4* DELIMS= " %%I IN ('DIR /C /A:A /O:D^|FIND /I "MP3"') DO (
CALL :NEXT_DO_COPY %%I
)
COPY %FILE% NEW /Y
GOTO END
:NEXT_DO_COPY
@SET FILE=%1
:END

你可能感兴趣的:(DOS)