Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.
@echo off>NextSat.vbs echo wscript.echo FormatDateTime(Date + (7 - Weekday(Date)))For /f "delims=" %%D in ('cscript //nologo NextSat.vbs') do set nextsaturday=%%Ddel NextSat.vbsecho Next Saturday Is %Nextsaturday%
Next Saturday Is 31/07/2010
convert the output date format from dd/mm/yyyy to yyyymmdd'
set yyyy=%NextSaturday:~6,4%set mm=%NextSaturday:~3,2%set dd=%NextSaturday:~0,2%set yourformat=%yyyy%%mm%%dd%echo %yourformat%
set yyyy=%NextSaturday:~6,4%set mm=%NextSaturday:~3,2%set dd=%NextSaturday:~0,2%set yourformat=%yyyy%%mm%%dd%echo yourformat %yourformat%
assuming %NextSaturday% is dd/mm/yyyy
@echo off>NextSat.vbs echo wscript.echo FormatDateTime(Date + (7 - Weekday(Date)))For /f "delims=" %%D in ('cscript //nologo NextSat.vbs') do set nextsaturday=%%Ddel NextSat.vbsset yyyy=%NextSaturday:~10,4%set mm=%NextSaturday:~4,2%set dd=%NextSaturday:~7,2%set yourformat=%yyyy%%mm%%dd%echo Next Saturday Is %Nextsaturday%echo yourformat %yourformat%
Next Saturday Is 7/31/2010yourformat /210
@echo off>NextSat.vbs echo NextSaturday=FormatDateTime(Date+(7-Weekday(Date)))>>NextSat.vbs echo SY=Year(NextSaturday)>>NextSat.vbs echo SM=Month(NextSaturday)>>NextSat.vbs echo SD=Day(NextSaturday)>>NextSat.vbs echo wscript.echo SY ^& "," ^& SM ^& "," ^& SDFor /f "tokens=1-3 delims=," %%A in ('cscript //nologo NextSat.vbs') do ( Set yyyy=%%A Set mm=%%B Set dd=%%C )del Nextsat.vbsIf %mm% lss 10 Set mm=0%mm%If %dd% lss 10 Set dd=0%dd% Set Result=%yyyy%%mm%%dd%echo Next Saturday is %Result%pause
Next Saturday is 20100731
@echo offsetlocal enabledelayedexpansion>evaluate.vbs echo Wscript.echo eval(WScript.Arguments(0))set VBcmd=cscript //nologo evaluate.vbsset NDW=SaturdayFor /L %%A in (1,1,7) do for /f "delims=" %%N in ('%VBcmd% "weekdayname(weekday(date+%%A))"') do if "%%N"=="%NDW%" set Offset=%%Afor /f "delims=" %%Y in (' %VBcmd% "year(date+%Offset%)" ') do set yyyy=%%Yfor /f "delims=" %%M in (' %VBcmd% "month(date+%Offset%)" ') do set mm=%%Mfor /f "delims=" %%D in (' %VBcmd% "day(date+%Offset%)" ') do set dd=%%Dif %mm% LSS 10 set mm=0%mm%if %dd% LSS 10 set dd=0%dd%del evaluate.vbsecho Next %NDW% is %yyyy%%mm%%dd%pause
@echo off>NextSat.vbs echo wscript.echo FormatDateTime(Date + (7 - Weekday(Date)))For /f "delims=" %%D in ('cscript //nologo NextSat.vbs') do set nextsaturday=%%Decho Next Saturday Is %Nextsaturday%set yyyy=%NextSaturday:~5,4%set mm=%NextSaturday:~2,2%set dd=%NextSaturday:~0,1%set yourformat=%yyyy%/%mm%/%dd%echo %yourformat%
Hey Salmon.You are getting help from VBscript or windows script.Is it fair?
Curious. This post and it's thinly veiled passive sentence form reinforce my suspicions.
Are youl?
Well, if we needed a post to confirm our suspicions, that would be it.
Only Victoria and Vishuvishal have been logged on at the same time.Their IP address for Victoria and Vishuvishal indicates they are not the same person.
set Pdate=%date:~10,4%%date:~4,2%%date:~7,2%
So, RoyBailey, will that script work anywhere in the world? aug.jpg
My solution for finding next Saturday is with batch.
ST does not use batch.
But it doesnt find the following Saturday, unless you tell it how many days there are until next Saturday.
Thanks a lot Salmon!!!You ROCK!!!!!! Ban-chaIssue resolved.
RoyBailey, you are one of the most astonishingly stupid imbeciles it has ever been my misfortune to encounter. I see you shirk any discussion of your code. The OP has a choice between: code that works and your lunatic nonsense, which you posted a long while after this very touching message.I fear that ComputerHopes effectiveness will be gravely compromised until some method of permanently banning is found.
The people who use the Computerhope Board can filter the good code from the bad.
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% Now I want to pass next saturday date in place of current date.
Right now I am able to append the current date by using the below mentioned logicset Pdate=%date:~10,4%%date:~4,2%%date:~7,2% {Now I want to pass next saturday date in place of current date.
The ComputerHope member who is so upset has worked on his Saturday Code for years.
His code works well.
I have only worked on the Saturday Code for a day or two. My code has a few bugs that can be workedout.
My code is strickly batch and in the end will work better.
Bill, wherever you got your "BS.c", I'm not going there.
Right now I am able to append the current date by using the below mentioned logicCode:set Pdate=%date:~10,4%%date:~4,2%%date:~7,2% Now I want to pass next saturday date in place of current date.
http://www.unix.com/windows-dos-issues-discussions/140891-how-get-next-saturdays-date.html Does the above work when next saturday is next month?
You can get an edited version of my vbs script from a Unix board.
VBS Script does not belong to Salmon Trout. VBS Script is owned by Microsoft.
True, but I wanted to see how my insult generator worked.
<a href="http://www.google.com/#hl=en&source=hp&q=insult+generator&aq=0p&aqi=g-p1g9&aql=&oq=insult+&gs_rfai=&fp=93c3c78db929eee0">Click me!</a>
set Pdate=%date:~10,4%%date:~4,2%%date:~7,2% Now I want to pass next saturday date in place of current date.