Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: how to get next saturday 'Date' in DOS batch file  (Read 26655 times)

0 Members and 1 Guest are viewing this topic.

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: how to get next saturday 'Date' in DOS batch file
« Reply #45 on: August 24, 2010, 09:40:27 AM »
True, but I wanted to see how my insult generator worked.
I was trying to dereference Null Pointers before it was cool.

Fields



    Beginner

    Thanked: 3
    How to get next saturday Date in DOS batch file
    « 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.
    Member of the Human Race; Citizen of the World.

    gpl



      Apprentice
    • Thanked: 27
      Re: how to get next saturday 'Date' in DOS batch file
      « 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

      kpac

      • Web moderator


      • Hacker

      • kpac®
      • Thanked: 184
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 7
      Re: how to get next saturday 'Date' in DOS batch file
      « 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>

      gpl



        Apprentice
      • Thanked: 27
        Re: how to get next saturday 'Date' in DOS batch file
        « Reply #49 on: August 24, 2010, 02:16:01 PM »
        Cheers :)

        Fields



          Beginner

          Thanked: 3
          How to get next saturday Date in DOS batch file
          « 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>
          Member of the Human Race; Citizen of the World.

          Allan

          • Moderator

          • Mastermind
          • Thanked: 1260
          • Experience: Guru
          • OS: Windows 10
          Re: how to get next saturday 'Date' in DOS batch file
          « 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.