Related:
- BATCH DELETE
- Delete my whatsapp account without app - Guide
- How to delete whatsapp account without phone - Guide
- How to delete snapchat account - Guide
- How to delete icloud tabs - Guide
- Ping batch file output to text - Guide
3 responses
C:\scripts>more cleanup_display.bat
@ECHO OFF
SETLOCAL
SET targetPath=C:\scripts\scripts\logs
SET targetFiles=*.log
SET aMonthBefore=20090214
FOR /f %%z IN ('dir /b %targetPath%\%targetFiles%') DO (
FOR /f "tokens=1-4 delims=/ " %%a IN ('dir %targetPath%\%%z') DO (
IF "%%c%%a%%b" LSS "9" (
FOR /f "tokens=1-4 delims=(" %%1 IN ("%%c%%a%%b") DO (
IF "%%2"=="" (
IF %%c%%a%%b LSS %aMonthBefore% (
ECHO Detect file older than %aMonthBefore% ::::: -- %%z -- %%c%%a%%b
) ELSE (
ECHO Defect file newer than %aMonthBefore% ::::: -- %%z -- %%c%%a%%b
)
)
)
)
)
)
C:\scripts>dir C:\scripts\scripts\logs\*.log
Volume in drive C has no label.
Volume Serial Number is 0D38-406F
Directory of C:\scripts\scripts\logs
07/22/2008 08:50 PM 16,640 bck_20080722.log
07/24/2008 03:36 PM 1,067 bck_20080724.log
02/18/2009 11:07 AM 0 msms.log
3 File(s) 17,707 bytes
0 Dir(s) 47,139,299,328 bytes free
C:\scripts>cleanup_display.bat
Detect file older than 20090214 ::::: -- bck_20080722.log -- 20080722
Detect file older than 20090214 ::::: -- bck_20080724.log -- 20080724
Defect file newer than 20090214 ::::: -- msms.log -- 20090218
@ECHO OFF
SETLOCAL
SET targetPath=C:\scripts\scripts\logs
SET targetFiles=*.log
SET aMonthBefore=20090214
FOR /f %%z IN ('dir /b %targetPath%\%targetFiles%') DO (
FOR /f "tokens=1-4 delims=/ " %%a IN ('dir %targetPath%\%%z') DO (
IF "%%c%%a%%b" LSS "9" (
FOR /f "tokens=1-4 delims=(" %%1 IN ("%%c%%a%%b") DO (
IF "%%2"=="" (
IF %%c%%a%%b LSS %aMonthBefore% (
ECHO Detect file older than %aMonthBefore% ::::: -- %%z -- %%c%%a%%b
) ELSE (
ECHO Defect file newer than %aMonthBefore% ::::: -- %%z -- %%c%%a%%b
)
)
)
)
)
)
C:\scripts>dir C:\scripts\scripts\logs\*.log
Volume in drive C has no label.
Volume Serial Number is 0D38-406F
Directory of C:\scripts\scripts\logs
07/22/2008 08:50 PM 16,640 bck_20080722.log
07/24/2008 03:36 PM 1,067 bck_20080724.log
02/18/2009 11:07 AM 0 msms.log
3 File(s) 17,707 bytes
0 Dir(s) 47,139,299,328 bytes free
C:\scripts>cleanup_display.bat
Detect file older than 20090214 ::::: -- bck_20080722.log -- 20080722
Detect file older than 20090214 ::::: -- bck_20080724.log -- 20080724
Defect file newer than 20090214 ::::: -- msms.log -- 20090218
logonserver
Posts
5
Registration date
Sunday August 31, 2008
Status
Member
Last seen
March 31, 2009
12
Sep 23, 2008 at 02:33 PM
Sep 23, 2008 at 02:33 PM
hello,
here is a link which might help you for the batch file you are willing to create :
http://www.wilsonmar.com/1wsh.htm
here is a link which might help you for the batch file you are willing to create :
http://www.wilsonmar.com/1wsh.htm
Mar 26, 2009 at 11:33 AM
Regards
Rich
May 20, 2009 at 07:44 PM
Thanks.