How to get next Saturday's 'Date'?

Hi am trying to get the upcoming Saturday date in the batch file.
Kindly help ASAP. its urgent.
:confused:

Hi.

Which OS are you using?

In GNU date, for example, you could say:

date +%Y-%m-%d -d saturday
2010-07-24

or for the next one

date +%Y-%m-%d -d "saturday week"
2010-07-31

hi Scottn,
Thanks for the prompt reply.
I am using Windows 2000 terminal and the above code is not working for me

So you are trying to get help with a "windows batch" file in the Unix/Linux forum?

Moved to Windows & DOS: Issues & Discussions.

Your question is a bit vague. Not clear whether you need to calculate this date or whether you just wish to provide the date as a parameter.

If you need to calculate this future date on a regular basis this is actually quite difficult even when processing the output from "DATE /T" using "Windows Scripting Host" or some other extension to Windows Batch. Try Microsoft Development Network forums.

If the date just comes from visually reading a calendar, can you post the Batch File highlighting where the date is needed and explain how you expect to pass the date to the Windows Batch script - and in what format.

Date and Time Arithmetic in JScript

Google is your friend.

Hi,
Let me clarify

I have a dos batch file which processes a text file and generates a .csv output file. I want to append the next Saturday date to the output file name.
Right now I am able to append the current date by using the below mentioned logic

set Pdate=%date:~10,4%%date:~4,2%%date:~7,2% {setting current date to variable}
-outputFile %OUTDIR%\AglItemMaster_"%PDATE%".csv

now I want to pass next saturday date in place of current date.
Kindly help.
A quick response will be really helpful.

---------- Post updated at 01:51 AM ---------- Previous update was at 01:46 AM ----------

Hi,
Let me clarify

I have a dos batch file which processes a text file and generates a .csv output file. I want to append the next Saturday date to the output file name.
Right now I am able to append the current date by using the below mentioned logic

set Pdate=%date:~10,4%%date:~4,2%%date:~7,2% {setting current date to variable}
-outputFile %OUTDIR%\AglItemMaster_"%PDATE%".csv

now I want to pass next saturday date in place of current date.
A quick response will be really helpful.
Thanks in advance.

Sorry, I don't know any quick dodge in Windows to calculate "next Saturday's date". You already have the YYYY, MM, DD values needed to seed the calculation but not today's day of the week.

Btw Your date format in %date% must be quite different from mine.
Mine is in the format "dd/mm/yyyy" (10 characters).
Therefore yyyymmdd=%date:~6,4%%date:~3,2%%date:~0,2%

Thanks a lot all for all you support. I got this solution from the internet

@echo off
>NextSat.vbs echo wscript.echo FormatDateTime(Date + (7 - Weekday(Date)))
For /f "delims=" %%D in ('cscript //nologo NextSat.vbs') do set nextsaturday=%%D
del NextSat.vbs


echo Next Saturday Is %Nextsaturday% :b:

or

@echo off
>#.vbs echo wsh.echo "Set Nextsaturday="^&dateAdd("d",7-Weekday(Date),date)
for /f "delims=" %%_ in ('cscript /nologo #.vbs') do %%_
del #.vbs

set Nextsaturday