General discussion

  • Creator
    Topic
  • #2324723

    Scheduling through a script

    Locked

    by ehendric ·

    I am trying to find a way to schedule a file to be overwritten monthly on certain machines, I know how to specify the machines, but I don’t know what kind of commands I can use to figure out the date (i.e. 4th Monday). I would like to do this through the logon script. I am running NT and 2K workstations.

All Comments

  • Author
    Replies
    • #3410297

      Scheduling through a script

      by timthetoolman ·

      In reply to Scheduling through a script

      Hi,

      If you’re doing this in a batch file (rather than something more powerful like Perl) then you’ll likely be using things like…

      date /t > somefile.txt

      and then…

      E:\Documents and Settings\Tim Medhurst>date /t > temp.txt

      E:\Documents and Settings\Tim Medhurst>type temp.txt
      Tue 11/06/2002

      E:\Documents and Settings\Tim Medhurst>for /f “tokens=1,2,3,4 delims=/ ” %i in (
      temp.txt) do echo %i %j %k %l

      E:\Documents and Settings\Tim Medhurst>echo Tue 11 06 2002
      Tue 11 06 2002

      The for statement will read that file and tokenise the components of the date. You’ll do the calculations based on the results of that.

      do a for /?

      for more information on how the for statement operates. Its quite powerful.

      Cheers,
      Tim.

    • #3398118

      Scheduling through a script

      by ehendric ·

      In reply to Scheduling through a script

      This question was closed by the author

Viewing 1 reply thread