My computer has an issue with the folder C:\Program appearing occasionally, I'm uncertain on how to fix that as I haven't installed anything new when it appears and I've tried Procmon to figure out which program is doing it without luck. This message popup thing and the folder don't appear on every boot so it's an absolute pain to fix. I might make a different question about that.
For now I've tried to just use a script to delete the folder and allow normal programs to run, but windows apparently makes startup programs, from the registry (HKLM\SOFTWARE\Microsoft\Windows\Currentversion\Run) and the startup folder wait until the issue has been resolved or skipped.
I have automatic sign-in on and am not always there to click that button to either rename or skip the issue, so it is rather problematic.
Is there a way to force this script to run on startup? I have noticed that some programs run despite windows making others wait i.e. antivirus and some utilities, could I utilise this somehow?
Thanks and sorry if this is more Stack Overflow material.
Edit: Added the word wait, which I missed
Edit2: As clarification: Different from suggested dupe in that the methods in said post do not work as windows forces these two (the startup folder, and registry) to wait until pressing either "Rename" or "Skip"/whatever it is in english, in the prompt about the C:\Program folder. The third method of task scheduler is yet uncertain as I haven't tested it. It is very hard to test this under 100% natural circumstances as the folder only appears occasionally.