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.
|# 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.