Answer the question
In order to leave comments, you need to log in
How to implement automatic launch of the application?
Good afternoon. Tell a newbie in programming if this can be done.
There is a Win32 application that must be constantly running for users.
Those. when you start Windows, it should be automatically launched, after closing / crashing it should automatically restart.
Google says this is implemented using a windows service. But the problem is that I first need to specify the directory from which to run this program (for different users it can be installed in different places), and then monitor the process and restart the program.
I thought of making WinForms, in which one could specify the path to the program, as well as manage the service. But I did not find whether it is possible to call the service and pass a parameter to it.
Can you tell me how to implement this functionality?
Answer the question
In order to leave comments, you need to log in
But the problem is that I first need to specify the directory from which to run this program (it can be installed in different places for different users)
In theory, you need to register your program in the autorun registry branch.
In the Windows 7 registry, startup is represented in several branches: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run] - programs that run at logon. Programs that run in this section run for all users on the system
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question