In a batch file, I'm calling another batch file to set a number of date environment variables.
The data variables set properly and I can call them.
However, in this instance, I need to compare two of these environment variables and determine if they are the same in order to conditionally launch the rest of the batch (or skip to end/exit).
However, I cannot seem to get the conditional to execute the test (comparison) of the two environment variables.
These are defined as %today2% (today's date set as MMDDYY) and %firstmonday%, which is a calculated first Monday of the month and set as MMYYDD). When run today (October 14, 2015), these return 101415 and 110215.
I am then attempting to test these in the following way:
if %today2%==%firstmonday% goto GO else END
However, the test seems to be completely ignored -- the test always proceeds to GO regardless.
echo %today% and
%firstmonday% they are of course different, but somehow the test evaluates to true and executes.
If I'm not explaining myself clearly, please let me know and I'll try to do a better job of it. I'm rather a novice when it comes to this, but have mucked around with it for a while and cannot seem to figure out the logic flaw.