How do you tell Windows to run a command on each system startup?
I have a large number of servers on which I will need to run a command on system startup that makes a non-persistent configuration change.
I can run the command either:
- as an executable with multiple parameters
- as a batch file that calls above executable with appropriate parameters
How do I instruct Windows to run my command on every boot, without any sort of login?
If you need to set the startup script programatically, you can use Scheduled Tasks:
To run the task with elevated permissions (Vista and later), add the parameter
/RL HIGHEST
Define a startup script with your desired BAT file. Do this either via Local Computer Policy (for standalone machines) or via GPO (if in a domain.)
Use Group Policy to run a Computer Startup script - this will run when the machine starts up without needing someone to login