Home / Microsoft / Microsoft DOS / how to get next saturday 'Date' in DOS batch file
0 Members and 3 Guests are viewing this topic. « previous next »
Pages: 1 2 3 [4]  All - (Bottom) Print
Author Topic: how to get next saturday 'Date' in DOS batch file  (Read 4368 times)
BC_Programmer
Mastermind


Thanked: 697
Posts: 15,874

Computer: Specs
Experience: Beginner
OS: Windows 7


Pinkie Pie is best pony

BC-Programming.com 1 1
« Reply #45 on: August 24, 2010, 09:40:27 AM »

True, but I wanted to see how my insult generator worked.
IP logged

My Blog

BASeBlock 2.3.0 (NOW WITH MACGUFFINS!)
Fields
Beginner



Thanked: 3
Posts: 56


« Reply #46 on: August 24, 2010, 11:55:16 AM »

True, but I wanted to see how my insult generator worked.

Such beautiful, kind  posts are good advertisement to all vistors to the Computerhope site.

Your PR rating is excellent.
IP logged

Member of the Human Race; Citizen of the World.
gpl
Apprentice



Thanked: 25
Posts: 547




« Reply #47 on: August 24, 2010, 12:07:07 PM »

True, but I wanted to see how my insult generator worked.
Plz send me codez 4dis ;D
IP logged
kpac
Web moderator
Hacker



Thanked: 180
Posts: 5,874

Certifications: List
Computer: Specs
Experience: Expert
OS: Windows 7
kpac®

1 1 1
« Reply #48 on: August 24, 2010, 12:25:04 PM »

Code: [Select]
<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>
IP logged

gpl
Apprentice



Thanked: 25
Posts: 547




« Reply #49 on: August 24, 2010, 02:16:01 PM »

Cheers :)
IP logged
Fields
Beginner



Thanked: 3
Posts: 56


« Reply #50 on: August 24, 2010, 02:32:05 PM »



set Pdate=%date:~10,4%%date:~4,2%%date:~7,2%

Now I want to pass next saturday date in place of current date.

The following VBS/Batch finds Saturday date when Saturday is next month. Current date is current date + 7( ran 8/23/2010).  A for loop is not necessary. 

@echo off

cscript //nologo sattwo.vbs  > cdate.txt
type cdate.txt
set /p nextsaturday=<cdate.txt
set nextsaturday=%nextsaturday:~0,8%

echo Next Saturday Is %Nextsaturday%
echo When Current date + 7

Output:

C:test> nix2.bat
9/4/2010 3:25:49 PM

Next Saturday Is 9/4/2010
When Current date + 7

C:test>type sattwo.vbs
CurrentDate=now +7
wscript.echo FormatDateTime(CurrentDate + (7 - Weekday(CurrentDate)))



C:test>
IP logged

Member of the Human Race; Citizen of the World.
Allan
Moderator
Genius



Thanked: 856
Posts: 14,482

Experience: Guru
OS: Windows 7



Forum Administrator
« Reply #51 on: August 24, 2010, 03:18:52 PM »

Okay, I'm going to assume zensar's question has been answered. If not zensar, please send me a PM. But for now, this thread is locked.
IP logged
Pages: 1 2 3 [4]  All - (Top) Print 
Home / Microsoft / Microsoft DOS / how to get next saturday 'Date' in DOS batch file « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.103 seconds with 19 queries.