General discussion

Locked

Scheduling through a script

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.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Scheduling through a script

by TimTheToolMan In reply to Scheduling through a scri ...

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.

Collapse -

Scheduling through a script

by ehendric In reply to Scheduling through a scri ...

Thanks for your help!

Collapse -

Scheduling through a script

by ehendric In reply to Scheduling through a scri ...

This question was closed by the author

Back to Windows Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums