Your %date:~0,2% is wrong. It should be %date:~4,2% in the US Here's a simpler script if %date:~4,2% == 01 set month3=JAN if %date:~4,2% == 02 set month3=FEB if %date:~4,2% == 03 set month3=MAR ...
echo %month3% You could add some quoting characters (if "%date:~4,2%" == "01" set month3=JAN) as a fail-safe, but you don't really need to do that since %date:~4,2% is not ever going to be blank From: [email protected] [mailto:[email protected]] On Behalf Of David McSpadden Sent: Thursday, February 20, 2014 9:12 AM To: '[email protected]' Subject: [NTSysADM] setting month value in a dos batch set month2=%date:~0,2% if "%month2%" == "01" then goto :Jan elseif "%month2%" == "02" then goto :Feb elseif "%month2%" == "03" then goto :Mar elseif "%month2%" == "04" then goto :Apr elseif "%month2%" == "05" then goto :May elseif "%month2%" == "06" then goto :Jun elseif "%month2%" == "07" then goto :Jul elseif "%month2%" == "08" then goto :Aug elseif "%month2%" == "09" then goto :Sep elseif "%month2%" == "10" then goto :Oct elseif "%month2%" == "11" then goto :Nov elseif "%month2%" == "12" then goto :Dec goto :nextvar :Jan set month3="JAN" goto :nextvar :Feb set month3="FEB" goto :nextvar :Mar set month3="MAR" goto :nextvar :Apr set month3="APR" goto :nextvar :May set month3="MAY" goto :nextvar :Jun set month3="JUN" goto :nextvar :Jul set month3="JUL" goto :nextvar :Aug set month3="AUG" goto :nextvar :Sep set month3="SEP" goto :nextvar :Oct set month3="OCT" goto :nextvar :Nov set month3="NOV" goto :nextvar :Dec set month3="DEC" :nextvar set month3 Gives me nothing?? What am I missing? I should see month3=FEB But nothing is what I am getting? This e-mail and any files transmitted with it are property of Indiana Members Credit Union, are confidential, and are intended solely for the use of the individual or entity to whom this e-mail is addressed. If you are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this email is strictly prohibited. Please consider the environment before printing this email.

