Monthly Download of Files

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
guru_sanjay
Posts: 2
Joined: 24 Jun 2009 04:57

Monthly Download of Files

#1 Post by guru_sanjay » 25 Jun 2009 03:42

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

jaffamuffin
Posts: 40
Joined: 25 Jan 2008 14:05

#2 Post by jaffamuffin » 25 Jun 2009 06:53

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.

ghostmachine4
Posts: 319
Joined: 12 May 2006 01:13

#3 Post by ghostmachine4 » 25 Jun 2009 07:45

download GNU coreutils and use the GNU date command

Code: Select all

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

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

#4 Post by avery_larry » 25 Jun 2009 09:56

You found the right website -- just needed to look in a different place:

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

Post Reply