I have trouble running a PowerShell script and/or and .exe file on boot with Windows (both win10 and win11). I have tried multiple methods:
- Put the script inside
shell:startup
- Create a task with Task Scheduler
- Run the task as a Windows service
Sometimes it runs, sometimes it does not. I have a feeling that Windows runs the task whenever it feel like to do that. On Linux, if I put the task inside cron, it is guaranteed to run.
Here is an example of a Windows service which is not run most of the time (but sometimes it does run):I have tried both
Automatic
and Automatic (Delayed start)
, yet the results are the same.
If you are curious, I want to run aria2c.exe
in RPC mode, so I create a task in Task Scheduler for it. I also want to run a .ps1
script so I put it inside the startup folder. And the VirtioFS service was created by default by the installer to start a virtual drive at boot. Yet everything behaves out of my control. What could be the cause of the issue?