Advertisement
yclee126

Remote PC shutdown using Dropbox

Jun 17th, 2022
1,341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. # remote shutdown using online file sync servies (OneDrive, Dropbox, etc..)
  2.  
  3. import os
  4. import time
  5.  
  6. file_name = "1 1 1 1 1 1.txt"
  7. open(file_name, 'w').close()
  8. print("File created")
  9.  
  10. while os.path.isfile(file_name):
  11.     time.sleep(1)
  12.  
  13. print("File deleted, computer will shut down after 5 seconds")
  14. time.sleep(5)
  15. os.system("shutdown -s -f -t 0")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement