Save this as mine.bat in the same folder as the cgminer.exe you are trying to run. You will need to edit the part on the cgminer line with your pool and user info and also add any options you usually run, like asicboost. Once you see that it is working, you can add a shortcut to the .bat to your startup folder.
@echo off
:start
start cmd.exe @cmd /c "cgminer -o stratum+tcp://solo.ckpool.org:3333 -u 1zsmithbYtyrcZ2jAAYwZHyAy28zv7pUY -p x"
timeout 21600
taskkill /F /IM cgminer.exe /T
timeout 2
goto start
Thanks for this. I've updated it and saved it in my Tools folder for another day... that's more of a reminder to me than for you!