w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Startup program stuck windows loading

It runs twice because you're setting the registry key in both Run and RunOnce. If you want it to run each time, just set it in the Run key. The RunOnce key is just for programs that you want to (as the name implies) run only once. The registry entry is automatically removed from RunOnce after the OS starts.

If you want to delay the program until the shell has started up, the easiest way (although a bit hacky) is to just put a Thread.Sleep(60000) at the very start of the the program.

If you want a more sophisticated solution, have a look here: C# - How to know when Windows is "settled" after startup?





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.