好也五怕多!!给大家带来“dhcp日志备份脚本”
 
@echo off
set num=0
for /f "delims=" %%i in ('dir /a-d /b C:\WINDOWS\system32\dhcp\*.log') do (
    if not exist "D:\dhcp日志文件\%%i" (
        copy "C:\WINDOWS\system32\dhcp\%%i" D:\dhcp日志文件>nul
    ) else call :copy_log "C:\WINDOWS\system32\dhcp\%%i" "%%~ni" %%~xi
)
goto :eof
:copy_log
set file_n=%2
set "file_n=%file_n:~1,-1%"
set file_x=%3
set /a num+=1
if not exist "D:\dhcp日志文件\%file_n%%num%%file_x%" (
    copy %1 "D:\dhcp日志文件\%file_n%%num%%file_x%">nul
) else call :copy_log %1 "%file_n%" %file_x%
set num=0
goto :eof