Dos Batch Looping


[ Follow Ups ] [ Post Followup ] [ The EasyDOS Forum ] [ FAQ ]

Posted by RatPack on November 08, 2007 at 20:23:52:

Using the Command Prompt in Win XP.

I want to be able to display the name of each month in a batch file. The relevant part of the file is:

@echo off
cls

set datemonth=%date:~4,2%
if %datemonth%==11 set datename=Nov

echo %datemonth% %datename%

But do I need 12 'if' statements to handle each of the 12 months or is there a better way with a loop?

Thanks


Follow Ups:



Post a Followup (use TAB key to move between boxes - NOT ENTER or RETURN)

Name:
E-Mail:

Subject:

Type your comments in the box below and SUBMIT:


[ Follow Ups ] [ Post Followup ] [ The EasyDOS Forum ] [ FAQ ]