Search notes:

Windows service: Schedule

The Task Scheduler.

Run a powershell script at start up

The following sequence of Powershell commands configures the task schuduler such that it starts a powershell script when the system starts up:
$act = new-scheduledTaskAction      -execute powershell.exe -argument '-file c:\project-X\Health-monitor.ps1'
$trg = new-scheduledTaskTrigger     -atStartup
$prc = new-scheduledTaskPrincipal   -userId "NT AUTHORITY\SYSTEM" -logonType ServiceAccount
$set = new-scheduledTaskSettingsSet -executionTimeLimit (new-timeSpan -seconds 0)  # Make sure task is not stopped if it runs longer than a given period.

register-scheduledTask -taskName 'Health monitor'  -action $act -trigger $trg -settings $set -principal $prc # -runLevel Highest

See also

schtasks.exe is the Task Scheduler Configuration Tool. Its deprecated cousin is at.exe.
taskschd.msc
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree
Programs that might automatically be started in Windows
new-scheduledTaskAction

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1788309323, '216.73.217.21', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/services/installed/Schedule(59): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78