I have a console application written in VB.Net. All I want is it to run automatically when the computer starts.
Create an entry in registry under
- Start regedit.exe
- Navigate to HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRun
- Create a new string value and give it tha title you please (it’s just for you, to rememeber what is it)
- Set the value to the full path (and params) of the EXE you want to run.
You can just simply add it to the Startup folder in the Start Menu in Windows and it will startup with the computer.
I would set it up in the task scheduler, run the scheduler from control panel / administrative tools, create a new task and set the trigger to “When the computer starts”.
Or you can do it in your setup program, or write some code using Microsoft.Win32.TaskScheduler.dll that is run within the setup program.
The simplest way to achieve this would be to convert your console application into a Windows Service.
However, you could look at the Scheduled Tasks and see if there is an option to start the application when the computer starts.