I made a script that uploads all the files in a predefined folder to the cloud. Now what I want is I want this script to run everytime the user tries to shut down the PC (running on windows 7) . So is there any way to achieve this ? Thanks in advance.
Asked
Active
Viewed 351 times
1 Answers
0
Open gpedit.msc
(local Policies).
And then, enter: Windows settings
-> Scripts
-> Shutdown
-> Properties
-> Add
In this file, you can write:
python <path_to_the_python_file>

Yuval Pruss
- 8,716
- 15
- 42
- 67
-
-
1You can call your python file from the BAT file... like: ```python
``` – Yuval Pruss Mar 18 '17 at 17:42 -
-
-
Allright. In any case, I founded this answer: http://stackoverflow.com/questions/101647/how-to-schedule-a-task-to-run-when-shutting-down-windows, maybe you find it helpful. – Yuval Pruss Mar 18 '17 at 17:47
-
I am trying to approve the answer but it says 'you can accept an answer in 8 minutes' – Zaid Khan Mar 18 '17 at 17:48