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

Author Topic: ad 7 days to a current date  (Read 2907 times)

0 Members and 1 Guest are viewing this topic.

Blackberry

    Topic Starter


    Adviser
  • For those with wings, fly to your dreams.
    ad 7 days to a current date
    « on: February 02, 2007, 02:03:18 PM »
    Does anyone know how to do, under winxp, add 7 days to a current date. For example:
    Code: [Select]
    >>c:/windows/WHsced.bat ECHO AT 20:30 /EVERY:[b]10[/b],31 c:/windows/WHmain.batI'd like that the 10 (see bald) in the code would be replaced by a week later then the current date. For example, now DOS would look the date, in my country we're the 2nd of the month on the moment of writing, so then DOS would say:

    Code: [Select]
    >>c:/windows/WHsced.bat ECHO AT 20:30 /EVERY:[b]9[/b],31 c:/windows/WHmain.bat
    Because 2+7=9


    And if we are the tirth tomorrow, etc

    Does anyone has an idea?
    « Last Edit: February 03, 2007, 05:40:58 AM by blackberry »
    Everybody knows you can't click here. But I know you will try it :)

    WillyW



      Specialist
    • Thanked: 29
    • Experience: Experienced
    • OS: Windows XP
    Re: ad 7 days to a current date
    « Reply #1 on: February 02, 2007, 05:42:15 PM »
    Quote

    Does anyone know how to do, under winxp,

     - - -

    Does anyone has an idea?


    Since I don't have XP,  I can't experiment with its scripting.   So I can't tell you how to do it with only the command line of XP.

    You'll probably get an answer here soon from someone that can.   I've seen a few members post here that appear to be very good with it.

    If however you don't get an answer soon,  let me know.   I can do it, under XP, but using a free utility program to manipulate the date, do the math,  and set an environment variable(s), that you can then do with whatever you want.    The method and batch files should work under XP just the same as they do under 98, etc.



    .



    DosItHelp



      Intermediate
      Re: ad 7 days to a current date
      « Reply #2 on: February 02, 2007, 06:57:42 PM »
      blackberry,

      Try this:
      [edit]@echo off
      CALL:jdate jd "%date%"
      SET /a jd+=10
      CALL:jdate2date jd y m d
      echo.file.%m%/%d%/%y%
      pause
      GOTO:EOF
       
      :jdate
      ...
      :jdate2date
      ...[/edit]

      Get the :jdate function from here http://www.dostips.com/DtCodeCmdLib.php#jdate
      Get the :jdate2date function from here http://www.dostips.com/DtCodeCmdLib.php#jdate2date
       
      DOS IT HELP?
      « Last Edit: February 02, 2007, 06:58:23 PM by DosItHelp »