有人可以帮助我使以下批处理文件仅处理365天以上的文件吗?
@echo off
SetLocal EnableDelayedexpansion
set "Folder=C:\Test Folder"
set "exclude=.dll.exe.bat.zip.jpg.bmp.pdf.mp4.vbs"
FOR /f "delims=" %%x IN ('dir /b /s "%Folder%" ') do if "!exclude:%%~Xx.=!"
equ "%exclude%" (
"7za.exe" a -sdel -stl "%%~dx%%~px%%~nx.zip" "%%x"
)
答案 0 :(得分:0)
@echo off
color 0A
SetLocal EnableDelayedexpansion
Set folder="C:\Test Folder"
Set exclude=".dll.exe.bat.zip.jpg.bmp.pdf.avi.mpg.mov.mp4.vbs.lnk"
FOR /f "delims=" %%x IN ('forfiles /p !folder! /d -365 /s /c "cmd /c echo @path"') do if "!exclude:%%~Xx.=!" equ "%exclude%" (
"7za.exe" a -sdel -stl "%%~dx%%~px%%~nx.zip" %%x
)