0

I have a windows batch file that outputs a file and takes in 4 variables.

batch.exe output_file.txt -1 dummy_variable1 -2 dummy_variable2 -3 dummy_variable3 -4 dummy_variable4

I want to run this command periodically, say after 1 minute, passing in a different output file name and different variables. Is there a way to do this without manually having to type the command and input the output file name and variables each time? For example, edit the command in a script and then echo it to the terminal each time to run it.

PaulAk
  • 1
  • 1
  • [check this answer](https://stackoverflow.com/a/2917778/9267296). If you use an [f-string](https://realpython.com/python-f-strings/) you can pass variables from within your python script to the batch file. – Edo Akse Jun 16 '21 at 17:58
  • You can use the combination of the time module and using an f-string. – Peter Jones Jun 16 '21 at 18:05
  • I wrote a powershell function that would make this pretty easy, starting with the parameter list in a csv file. https://stackoverflow.com/questions/42230306/how-to-combine-a-template-with-a-csv-file-in-powershell – Walter Mitty Jun 16 '21 at 18:50
  • Windows should have some `Task Scheduler` similar to `cron` on LInux which let you run script periodically - and in this script you should get different values and run your batch. – furas Jun 16 '21 at 20:35

0 Answers0