Computing.Net > Forums > Disk Operating System > checking a file date to execute a batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

checking a file date to execute a batch file

Reply to Message Icon

Name: Laura
Date: January 11, 2000 at 11:57:51 Pacific
Comment:

I would like to create a batch file for a client/server environment which run if the date of the file does not match. How would the if statement be worded, is it possible?? Thanks in advance.
ie:
If file date (does not) = 12/31/99 then run update.bat



Sponsored Link
Ads by Google

Response Number 1
Name: Dan The Man
Date: January 11, 2000 at 19:33:33 Pacific
Reply:

Hi Laura,

Here's a sample of a batch file you could use:

-------------------------------------------
:if date = "01-11-2000"
goto end
:if date <> "01-11-2000"
update.bat

:end
dothis.bat
-------------------------------------------

Be sure to use a 4-digit year and the "-" symbol for the date syntax.

Hope this helps.

Dan


0

Response Number 2
Name: Laurence
Date: February 12, 2000 at 08:43:39 Pacific
Reply:

:: ckdate.bat
@ECHO off
DIR filename |FIND "12/31/99" >nul
IF not errorlevel=1 GOTO end
%place update code here%
:end


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: checking a file date to execute a batch file

User log in date from a batch file www.computing.net/answers/dos/user-log-in-date-from-a-batch-file/7783.html

How to execute a .cfg file www.computing.net/answers/dos/how-to-execute-a-cfg-file/14242.html

Is there any ways to declare a variable inside a batch file ?? www.computing.net/answers/dos/is-there-any-ways-to-declare-a-variable-inside-a-batch-file-/3377.html