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:
- Run gpedit.msc (Local Policies)
- Computer Configuration -> Windows Settings -> Scripts -> Startup or Shutdown -> Properties -> Add
For Logon/Logoff:
- Run gpedit.msc (Local Policies)
- 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