Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically run program on Windows Server startup

I am trying to create and install a .NET app on a windows server that is always on, but I am running into problems. I have heard that I should not make it a Windows service (and would personally rather have a dialog app so I can see progress, etc) so I am trying to use the task scheduler. However, the task scheduler keeps trying to close my app prematurely, when it should only open it and leave it open.

Any ideas how I could have my dialog app run on startup (and stay running) on my server?

like image 237
Rob Avatar asked May 13 '11 02:05

Rob


People also ask

How do I automatically start a program at startup?

Add apps to startup in Windows 10. Open Run command box by pressing Windows logo + R keys. In the Run command field, type shell: startup and then press Enter key to open Startup folder. Copy and paste the app shortcut from the desktop to this Startup folder and the app will be added to startup.

How do I add a program to the startup in Windows Server 2008?

Please open Task Scheduler and create a task. Then click Triggers tab and configure Begin the task: At startup. Then also click Actions tab, configure Action: Start a program and add that programs which you want to start when server start. In addition, you can also consider computer startup scripts.


1 Answers

You can do it with a Scheduled Task which wont have problems with users logging on/off.

  1. Open Task Scheduler, Windows Key + R

Taskschd.msc

  1. Click Action menu > Create Task

enter image description here

  1. Change the User to a Administrator or preferably a Service Account and note the option to Run whether user is logged in "or not":

enter image description here

  1. Set At Log On:

enter image description here

  1. Set a program to start:

enter image description here

like image 103
Jeremy Thompson Avatar answered Oct 01 '22 18:10

Jeremy Thompson