Batch File To Check Date

November 23, 2010 at 13:30:09
Specs: Windows XP
Hey, I'm having a problem with a batch file im trying to make. What i want to do is have the batch file check what date it is and if it is a certain date echo a message. This is what i have so far.
@echo off
if %date%==Mon 1/1/2010 goto 1
:1
echo hello
pause

Help will be appreciated. Thanks


See More: Batch File To Check Date

Report •


#1
November 23, 2010 at 18:31:43
Enclose the strings in " "

If "date%"=="Mon 1/1/2010" goto 1

Did you Google for an answer before asking the question?


Report •

#2
November 23, 2010 at 20:25:52
Little point in a goto that goes to the next line. LOL


=====================================
Life is too important to be taken seriously.

M2


Report •

#3
February 24, 2011 at 19:11:01
You might be better off replacing your battery. Apparently you are losing clock function and the bios is resetting to original motherboard manufacturing default.

However once you know the default date set in the bios you can set this file to bring up the date and time setting function from the control panel by calling "timedate.cpl". I have similar problem with one of my mini-itx boards. Although the battery is good occasionally the bios gets reset for no reason at all.


Report •

Related Solutions

#4
February 24, 2011 at 23:58:15
pmshah

I guess you pasted that into the wrong thread.


=====================================
Life is too important to be taken seriously.

M2


Report •


Ask Question