//

3958
12
Jump to solution
10-02-2019 09:37 AM
_____
by
New Member
 
0 Kudos
12 Replies
_____
by
New Member

//

0 Kudos
maryandrews
New Contributor III

Thank you Ian Broad

0 Kudos
GIS_Spellblade
Occasional Contributor

I think that this might be a more satisfying answer to anyone seeking to have a standalone scripting server without paying an additional license fee for a single-use installation.

Assuming that you have a Named User login with a remember my password option, this will only operate for 14 days at a time. This clock resets any time the program is opened. So we can use Python to open ArcGIS Pro on an X day schedule and close it afterward. The basic script will look something like this, but obviously you would want to write some logic for logging, emails, and etc.

#We'll be using two built-in libraries with this script
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‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

This will free up a license that would otherwise only be used to run scripts.

0 Kudos