Det burde nu sagtens kunne. Jeg er heller ikke logget ind, og jeg kan godt se svaret.
Men svaret kommer her:
This may be the quickest/easiest solution for you:
http://www.michna.com/software.htm#DelOldSpecify the file types you want to delete along with the age...
DelOld.exe C:\TEMP\*.* 7
Obsolete is another tool for this:
http://users.aol.com/pasacaca/obsolete/obsolete.zipOr you can try SteveGTR's solution here: http:Q_20947290.html
http:Q_20947290.html
Try this:
@echo off
setlocal
set yyyy=
set $tok=1-3
for /f "tokens=1 delims=.:/-, " %%u in ('date /t') do set $d1=%%u
if "%$d1:~0,1%" GTR "9" set $tok=2-4
for /f "tokens=%$tok% delims=.:/-, " %%u in ('date /t') do (
for /f "skip=1 tokens=2-4 delims=/-,()." %%x in ('echo.^|date') do (
set %%x=%%u
set %%y=%%v
set %%z=%%w
set $d1=
set $tok=))
if "%yyyy%"=="" set yyyy=%yy%
if /I %yyyy% LSS 100 set /A yyyy=2000 + 1%yyyy% - 100
REM Substract your 7 days here
set /A dd=1%dd% - 100 - 7
set /A mm=1%mm% - 100 + 0
if /I %dd% GTR 0 goto DONE
set /A mm=%mm% - 1
if /I %mm% GTR 0 goto ADJUSTDAY
set /A mm=12
set /A yyyy=%yyyy% - 1
:ADJUSTDAY
if %mm%==1 goto SET31
if %mm%==2 goto LEAPCHK
if %mm%==3 goto SET31
if %mm%==4 goto SET30
if %mm%==5 goto SET31
if %mm%==6 goto SET30
if %mm%==7 goto SET31
if %mm%==8 goto SET31
if %mm%==9 goto SET30
if %mm%==10 goto SET31
if %mm%==11 goto SET30
if %mm%==12 goto SET31
echo ERROR: unexpected month:
echo dd=%dd% mm=%mm%, yyyy=%yyyy%
goto :EOF
:SET31
set /A dd=31 + %dd%
goto DONE
:SET30
set /A dd=30 + %dd%
goto DONE
:LEAPCHK
set /A tt=%yyyy% %% 4
if not %tt%==0 goto SET28
set /A tt=%yyyy% %% 100
if not %tt%==0 goto SET29
set /A tt=%yyyy% %% 400
if %tt%==0 goto SET29
:SET28
set /A dd=28 + %dd%
goto DONE
:SET29
set /A dd=29 + %dd%
:DONE
if /i %dd% LSS 10 set dd=0%dd%
if /I %mm% LSS 10 set mm=0%mm%
set _CutOff=%yyyy%-%mm%-%dd%
set mm=
set yyyy=
set dd=
set tt=
REM ** Here is where you specify what you want to scan
for /F "delims=" %%i in ('dir /b /ad c:\htmlbackup') do if /I %%i LSS %_CutOff% echo rd "c:\htmlbackup\%%i" /s /q
set _CutOff=
Remove the echo statement to activate the rd command.
Good Luck,