Reputation: 2281
I am writing a batch file to continually look for files in a Unix samba shared directory, and if present copy them to a local Windows directory.
I need this script to run continuously (by means of a loop) between 0800 to 2000 hours.
I have looked in the task scheduler and there does not appear to accommodate times frames as triggers.
Is there a function I can use in a batch script that may allow this?
Upvotes: 0
Views: 176
Reputation: 17501
The Time
command (or Time /T
) shows the current time.
You can add a check in your batchfile, checking if the current time is between 08:00 and 20:00.
Examples of how to compare time variables in batch scripts can be found in this post.
Like this, you let your batchfile run always and the batchfile itself checks whether or not it should actually do something.
Upvotes: 1