using System.Collections;
using System.Collections.Generic;
static string command = @"%date% %time%
C:\Users\cledclaimschk05\Desktop\LegalBills_20211008\Bottomline.exe ""{0:yyyy-MM-dd HH:mm:ss}"" ""{1:yyyy-MM-dd HH:mm:ss}""
public static void Main()
var start = new DateTime(2022, 01, 18, 11, 00, 00);
var runTimes = new(int runHour, int runLength)[] {(6, 12), (11, 5), (15, 4), (18, 3)};
var daysToRun = Enumerable.Range(0, (end - start).Days + 1).Select(d => start.Date.AddDays(d));
IEnumerable<(DateTime start, DateTime end)> runs = daysToRun.SelectMany(d => runTimes.Select(t => (d.AddHours(t.runHour-t.runLength), d.AddHours(t.runHour))));
var runsToProcess = runs.Where(r => r.end > start && r.start <= end);
Console.WriteLine($"REM Running {runsToProcess.Count()} timeslots. Estimated time until completion is: {TimeSpan.FromMinutes(runsToProcess.Count()*15*0.71)}");
foreach (var run in runsToProcess)
Console.WriteLine(String.Format(command, run.start, run.end));