Get the ArcCatalog connections folder location for current user

I wrote this gist because I was tired of manually building up the path for the location where ArcCatalog stores SDE, database and ArcGIS Server connection files. I work on several different machines, so it was very painful to have to change my script each time.

import arcpy
import os
# Detailed description
os_appdata = os.environ['APPDATA'] # Current user's APPDATA folder
folder_esri = "ESRI" # ESRI folder name
arc_prod = arcpy.GetInstallInfo()['ProductName'] # Get the installed product's name e.g. Desktop
arc_ver = arcpy.GetInstallInfo()['Version'] # Get the installed product's version number
arc_cat = "ArcCatalog" # ArcCatalog folder name
arc_prod + arc_ver,

I’m considering creating a global functions file which I include with every toolbox/project, where these sorts of functions are readily available.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.