Skip to content

Instantly share code, notes, and snippets.

@FeralCatColonist
Last active July 26, 2022 01:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FeralCatColonist/9cae407c7200fa6a45f922c019e397c3 to your computer and use it in GitHub Desktop.
Save FeralCatColonist/9cae407c7200fa6a45f922c019e397c3 to your computer and use it in GitHub Desktop.
Avoid ArcGIS Pro 14-Day Login Expiration
import os
import time
#Assign the location on the machine, usually here
ArcGIS_Pro_filepath = r"C:\Program Files\ArcGIS\Pro\bin\ArcGISPro.exe"
#Use os.startfile(), this will launch ArcPro
os.startfile(ArcGIS_Pro_filepath)
#Use time.sleep() to wait 60 seconds, enough time for ArcPro to open properly
time.sleep(60)
#Use os.system() to forcefully quit named process, ArcGISPro.exe
#https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/taskkill
os.system("taskkill /f /im ArcGISPro.exe")
#You can use the following output to determine if the command was successful
#SUCCESS: The process "ArcGISPro.exe with PID 4408 has been terminated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment