You can do it with a Scheduled Task setup to run at startup time or on a schedule so there wont be problems with users logging on/off.
- Open Task Scheduler, Windows Key + R
Taskschd.msc
- Click Action menu > Create Task
- Change the User to a Administrator or preferably a Service Account and note the option to Run whether user is logged in "or not":
4a. Set At startup - nothing to do with Users logging in or off
4b. Or set At Log On - depends on Users logging on
4c. Or set On a schedule to work regardless of users being logged in:
- Set a program to start:
NOTE: Please use a Service Account to do this, if you use your Admin account then it will FAIL after changing password,
NOTE: For unattended applications choose a Console app as some user interfaces apps can have issues unless a user is logged on, it depends YMMV. In general don't keep windows alive, ie dont spawn MsgBox's - kill all windows after use or only have the one console app running in the background unattended. The last thing you want is to crash the computer with too many handles and GDI Objects left undisposed.
start /B your_console_app.exe
The /B
flag tells start to run the application in the background without creating a new window.