0

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.

Jokru
  • 27
  • 3
  • 8
  • 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](https://www.howtogeek.com/138159/how-to-enable-programs-and-custom-scripts-to-run-at-boot/), [Link 2](https://www.computerhope.com/issues/ch000322.htm). But please read the top 2 answers on [this link](https://answers.microsoft.com/en-us/windows/forum/windows_8-files/there-is-a-file-or-folder-called-cprogram-which/72e7f311-c6f2-45ee-a5a3-3457ea179f6d?page=2) to understand why this keeps happening – Jimmy_A Jul 07 '17 at 15:42
  • 1
    Possible duplicate of [Run a script on start up - Windows 10](https://superuser.com/questions/954950/run-a-script-on-start-up-windows-10) – Jimmy_A Jul 07 '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 07 '17 at 15:47
  • Possible duplicate of [Windows 10 Run Script on Power-On](https://superuser.com/questions/1223747/windows-10-run-script-on-power-on) – testeaxeax Jul 07 '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 07 '17 at 17:23
  • Which is why I am specifically asking how I might force this script to run, when most programs do not run when this issue happens, but some, like my antivirus, do – Jokru Jul 07 '17 at 17:28
  • At the moment I posted the comment you were missing a few things. Second, In the link I posted it says that if you install something in a new directory such as C:\program, not a new software installation. Which means that something you installed in the past had a C:\program destination folder, which tries to find it and everytime you rename it you have the same issue. Did you try the Task Scheduler, did it work? – Jimmy_A Jul 10 '17 at 08:21
  • Many people in the link say that it might be foxit reader related. Do you have this installed? Others say that there are some files in there. Have you opened them to see which software is related? If windows waits for response before running everything else, then your question doesn't have an answer. The ways to run a script on startup have been posted already. Maybe you should ask the real question. How to solve the folder issue, not bypass it. – Jimmy_A Jul 10 '17 at 08:46
  • @D.A The folder C:\Program is always empty when it comes up. I have read through the link and I have none of the mentioned programs. Currently everything is pointing at the culprit being a Fallout 4 modding utility, as I yesterday didn't launch Fallout 4 or any utilities involved and today didn't have the issue/popup. I currently very much need said utilities so uninstalling them is out of the question. This could also just be a coincidence; it could be a program that runs in the background every other or every third boot, but while Process monitor should help, it hasn't proved useful. – Jokru Jul 10 '17 at 12:00
  • @D.A No, windows only forces programs from these three most commonly used on boot launching methods to wait: Startup folder, registry run, taskscheduler. No, the task scheduler did not work. But programs like my antivirus, BitDefender, my remote control thing, Teamviewer and some others do not wait and instead launch and function normally, i.e. I can remotely access my P.C before clicking either "Skip" or "Rename" on the popup. – Jokru Jul 10 '17 at 12:03
  • @D.A Task scheduler might work if 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:07
  • maybe try this https://community.webroot.com/t5/Product-Questions/File-named-C-Program/m-p/78165#M868 – Jimmy_A Jul 10 '17 at 12:13

1 Answers1

0

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
MMXVIII
  • 1
  • 1