Page 1 of 1

Monthly Download of Files

Posted: 25 Jun 2009 03:42
by guru_sanjay
Hi,
We have to schedule an Batch file which connects to an FTP site and download files on the last working day of every month.

Our query is to calculate the weekday given an particular date of a month.

Please guide us on the above.

Regards
Sanjay

Posted: 25 Jun 2009 06:53
by jaffamuffin
I think this might depend on regional settings to make things quick and easy.

On my XP box:

Code: Select all

C:\>echo %date%
25/06/2009


on my win2k box

Code: Select all

Z:\>echo %date%
Thu 25/06/2009


Just extract the name from the output.

Other wise some kind of math calcualtion is going to have to be performed.

Or just have a separate text file with the start day of each month for the next few years or whatever, then just calcuate the difference.

Posted: 25 Jun 2009 07:45
by ghostmachine4
download GNU coreutils and use the GNU date command

Code: Select all

C:\test>date_gnu.exe "+%A" -d "2009-06-29"
Monday

Posted: 25 Jun 2009 09:56
by avery_larry
You found the right website -- just needed to look in a different place:

http://www.dostips.com/DtTipsDateTime.php