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