0

I want to run a python program/script before system shutdown (windows 10) I was searching for a folder like the startup folder but for shutdown I wasn't expecting to find a folder but tried it and I didn't found one so I wonder if there is any way to do it?

ShadowRanger
  • 143,180
  • 12
  • 188
  • 271
WolfDatka
  • 7
  • 1
  • Please provide enough code so others can better understand or reproduce the problem. – Community Aug 23 '22 at 12:47
  • Do the answers to this [question](https://superuser.com/q/773651) help at all? – quamrana Aug 23 '22 at 12:49
  • [How to schedule a task to run when shutting down windows](https://stackoverflow.com/q/101647/364696) (tagged for Windows XP, but gpedit.msc is still a thing on Windows 10, so it probably still works) and cross-site duplicate [How do I execute a script or program on Windows Shut Down](https://superuser.com/q/210122). Note that modern Windows implements a kill timeout when shutting down (possibly even just logging off?), two seconds IIRC, so if your script takes longer than that to complete, it may get forcibly terminated. – ShadowRanger Aug 23 '22 at 12:50

0 Answers0