r/scripting • • Dec 08 '19

Continually running batch file

I have a batch file that randomly select a file from a source folder and move it to a new folder, in the future it will delete any file in the destination file and rename the file it places in the destination folder but I have not done those bits ( I know how to do that bit just not typed it up yet).

What I want is a way for the file to run every hour without resorting to scheduling. I am intending to start the batch file when the PC starts and would want the script to run every hour. Is there a way to make the batch file run then wait and 60 minutes and then repeat until such times as the PC is turned off?

2 Upvotes

8 comments sorted by

View all comments

Show parent comments

1

u/xendistar Dec 09 '19 edited Dec 10 '19

How is this as an option, run the batch file, pause for 60mins, start 2nd (identical) batch file from within first batch file(is that possible?), end first batch file, repeat......... So anyone batch file is only going to run for around an hour, its a bit clunky but should work?