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.

  • I am not gonna tell you how to make a script to run on startup, cause there are hundred of questions and forums addressing that Link 1, Link 2. But please read the top 2 answers on this link to understand why this keeps happening – Jimmy_A Jul 7 '17 at 15:42
  • 1
    Possible duplicate of Run a script on start up - Windows 10 – Jimmy_A Jul 7 '17 at 15:43
  • You could use "taskschd.msc", Windows's task scheduler, to execute your script on startup, but it's a bit complicated on Windows 10/8 because of the "fast startup" feature, so probably the best way would be creating a task with a event as it's trigger and that event should be a system event generated on each startup, otherwise the task would only get executed on restart. – testeaxeax Jul 7 '17 at 15:47
  • Possible duplicate of Windows 10 Run Script on Power-On – testeaxeax Jul 7 '17 at 15:49
  • @D.A As I stated in the post, startup folder nor the registry work as windows forces these to wait, will try task scheduler next and as I also said the folder keeps reappearing, at one point I had renamed it so many times I had up to C:\Program9, I'm not installing anything new so it is a program I have, which is why I mentioned using procmon to try and figure which program creates the folder, without luck. – Jokru Jul 7 '17 at 17:23

What's wrong with adding the script to the Run registry? I think you missed a word or two.

Regardless, you could try adding it to Task Scheduler.

schtasks /create /sc ONLOGON /tn taskname /tr pathtoscript\script.cmd
  • Apparently I didn't type the word "wait", my apologies – Jokru Jul 7 '17 at 17:25
  • Apparently windows also makes this wait. – Jokru Jul 10 '17 at 12:04
  • Unless I run a script on boot, then make it wait until everything loads, I will set that up, but we'll only see after a while if it works. – Jokru Jul 10 '17 at 12:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.