Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Run batch file repeatedly at 15 min interval

Jul 23, 2009 9:59AM PDT

Hi Everybody

Is it possible to run a batch file repeatedly at 15 min (say) interval after a start time (or after an event say shutdown).

This is the essential requirement :-

1. I have a file server PC and 3 other PC's running on a home network.
2. I want to do a backup of the network drive residing on the file server PC.
3. Say at midnight each night, I want to run a backup job (using scripting through the use of a Shutdown script) which, as it runs for the first time at midnight, at the beginning checks if all the 3 PC's (PC's other than the file server PC) on this network are turned off. If that is the case, then it runs a scheduled backup job using the Genie Backup Pro 8 application (using the .grs script file). If any of these 3 PC's are not turned off, then it does nothing and waits for another 15 mins and does the check again. This procedure is repeated until all of these 3 computers are turned off and then run the scheduled backup job.

Hence, I need to know if I can run a batch file repeatedly following a test check at regular intervals.

Any suggestions on that please!


Best regards


Deepak Agarwal

Discussion is locked

- Collapse -
"or after an event say shutdown)."
Jul 23, 2009 10:37PM PDT

No. Here's why. The machine has shutdown and is not running.

As to running it at 15 minute intervals, that's just basic batch file commands. I will share how to delay 15 minutes in a batch file but will not write your batch file as that's your job.

Here's a 15 minute delay in a batch file:

TIMEOUT /T 900

Documented at http://technet.microsoft.com/en-us/library/cc754891(WS.10).aspx

- Collapse -
Incorrect
Jul 20, 2012 4:34PM PDT

You showed an example of a DELAY. The person wanted to know how to make the batch file REPEAT every 15 minutes. A 15 minute pause is only that, a pause, not a repeat. I did some research and it appears the external AT command is what you would need to make the batch file run at specified internvals.

http://www.computerhope.com/at.htm

- Collapse -
There will be
Jul 20, 2012 9:59PM PDT

many solutions to these batch file problems and we choose what we know or have learned.

I have to wonder why you are replying to a 3 year old thread. The OP is long gone.

Mark

- Collapse -
I offered just the delay and not the goto loop.
Jul 20, 2012 11:03PM PDT

Also you didn't offer a fix for running it after the machine was shutdown.

I appreciate you noting I only supplied a part of the solution but you as the programmer would be able tot add the one last line.
Bob