Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everybody,

I've several C++ app which I need to add to windows Startup. For that purpose I add my app path for in the windows registry, I use installers to do it automatically.

The Key where I put the app path it is:
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]

However, recently, I have some conflicts with third party softwares, Which I can easily solve by forcing my app to start up after the conflicting ones.

So my questions are:
*Is it possible to force the start up order? My apps starting after some other? (or this can be only done by adding them as a service?)

*Is it possible to add a delay on the app startup? For example add a app to the startup but adding 3 mintues delay.

Because this is a non frequent problem I don't want to add this delays in the code, and even because this only happens in the windows startup.
For later versions of the apps I will try to minimize this type of conflicts but for the actual ones I just want to fix it in this way.

Thanks for you reading time,
Apóstolo
Posted

1 solution

I don't know whether there's any way to do directly what you're asking; however, the first thing that pops into my mind would be to create a small app that you launch during Windows startup in place of your main app. The small app would sit back and wait for the "3 minutes" you're talking about, then launch your main app, then terminate. You'd only use this small app at Windows startup (or login). The main app would be the target of any other shortcuts (Start menu or desktop) so that there wouldn't be any delay in launching from the shortcut.
 
Share this answer
 
Comments
Apstolo 9-Aug-11 11:03am    
I like the Idea of the app. I could write a small App which in this specific cases I could use to force its waitings and call the other apps after the timeout. I think I will implement it. However I don't accept the solution because I hope there are ways of doing it with windows commands (I really hope).

Thank you very much for the idea!

Apóstolo
Marc A. Brown 9-Aug-11 11:11am    
I think you'll find that my solution is *the* solution, whether you write your own app or use some third-party tool to do the same thing. As far as I can tell, there isn't anything built into Windows to do what you want, although I'd be happy to be proven wrong.
I can understand why you might wait to accept my answer in hopes that a better solution will come along, but since you think you'll implement it, I'd appreciate it if you'd come back and accept this answer if something better *doesn't* come along.
Glad I could help!
Sergey Alexandrovich Kryukov 10-Aug-11 0:07am    
This is a good answer, so I voted 5. From the other hand, the idea of OP is really bad. To work around the conflict by timing cannot be reliable; the root of the problem is not eliminated.

I advice OP accept this answer; there is no way to essentially improve the answer ***without understanding of the nature of the conflict***; OP did not provide any relevant information (and probably don't have enough information of the conflict.

--SA
Marc A. Brown 10-Aug-11 13:58pm    
Thanks. I agree with you that the OP needs to find the source of the problem; however, he *did* say that he would attempt to minimize the problem with a future release and this provides a short-term workaround to the problem.
In any event, thanks for the vote of confidence! Have a great day!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900