Thursday, April 20, 2023

auto start/stop when onboot/shudown/logon/logoff

In addition to Dan Williams' answer, if you want to add a Startup/Shutdown script, you need to be looking for Windows Settings under Computer Configuration. If you want to add a Logon/Logoff script, you need to be looking for Windows Settings under User Configuration.

So to reiterate what Dan said with this information included,

For Startup/Shutdown:

  1. Run gpedit.msc (Local Policies)
  2. Computer Configuration -> Windows Settings -> Scripts -> Startup or Shutdown -> Properties -> Add

For Logon/Logoff:

  1. Run gpedit.msc (Local Policies)
  2. User Configuration -> Windows Settings -> Scripts -> Logon or Logoff -> Properties -> Add
cr.
https://stackoverflow.com/questions/101647/how-to-schedule-a-task-to-run-when-shutting-down-windows

for only one user
window+R
shell:startup
paste program in folder