1.

Solve : Check for today's date?

Answer»

Hi, I have a simple batch file that copies a file from a server to the client. I want to check the date on the server file first and not execute if it is not today. (So the actual date will VARY and cannot be hardcoded). Can someone help me with this?The environment variable %Date% holds the current date - the modifier to environment variables to RETRIEVE the last updated time of a file is %~tI

But be aware that date manipulation and comparisons in batch files are very tricky - and they all depend on the region settings in the CONTROL panel.

GrahamHi
Thanks for the reply. I COULD use a little help with syntax.

if focusfile.zip/Date = %Date% THEN
GOTO :PROCEED
ELSE
GOTO :MESSAGE
END IF



Discussion

No Comment Found