1.

Solve : File date?

Answer»

How can I start a command if a file is older then 2 days or 48 hour? :-?
Code: [Select]for /F %%A in ("filename.zip") do If %%~tA le %DATE%-1 echo OlderUnless you are prepared to write a boatload of if STATEMENTS, doing date arithmetic in batch code is not a simple matter. First you'd have to isolate the day value and SUBTRACT one. You can imagine the fun if the day value resolves to the first of the month.

Try one of the scripting languages available for Windows.

8-)Is it possible to create an log of last time the baths file was RUN and compare the last time to the file time?

O my that was a long SENTENCE...Quote

Unless you are prepared to write a boatload of if statements, doing date arithmetic in batch code is not a simple matter.

This utility program does simple arithmetic and date arithmetic:
http://www.ferg.org/fdate/

It is free.

Quote
First you'd have to isolate the day value and subtract one. You can imagine the fun if the day value resolves to the first of the month.

Try one of the scripting languages available for Windows.







Discussion

No Comment Found