Last active
July 26, 2022 01:58
-
-
Save FeralCatColonist/9cae407c7200fa6a45f922c019e397c3 to your computer and use it in GitHub Desktop.
Avoid ArcGIS Pro 14-Day Login Expiration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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