You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
520 B

  1. import ctypes
  2. import os
  3. def is_admin():
  4. return ctypes.windll.shell32.IsUserAnAdmin() != 0
  5. exe_path = os.path.expandvars(r"%userprofile%\portables"
  6. r"\foldertimeupdate"
  7. r"\FolderTimeUpdate.exe"
  8. )
  9. def update(*starts,force_admin = True):
  10. if not is_admin() and force_admin:
  11. raise Exception("Process must be admin")
  12. for start in starts:
  13. subprocess.check_call([exe_path,'/stext','null','/BaseFolder',start])