Arcpy – Adding Folder Connection in ArcMap Catalog Window Using Python

arcgis-10.1arcgis-desktoparcpypython-2.7

I have created a set of general scripting tools for map automation, etc. In one of my tools a geodatabase is created in the workspace folder the script points to. Just out of curiosity, is there any way I can add a folder connection in the ArcMap catalog window once the GDB is created so the user doesn't have to manually create one (assuming they haven't already done so), or is that out of ArcPy's scope?

Best Answer

No it is not possible to add "Folder Connections" using Arcpy.

Folder Connections are stored in the ArcCatalog.gx file, which is typically located at

 c:\Users\*username*\AppData\Roaming\ESRI\*Desktopverion*\ArcCatalog\ArcCatalog.gx

This is a binary file, so forget about editing it.

The only thing you could possibly do is to create the Folder Connections you want on one PC, copy the ArcCatalog.gx file to a common location, and then have your script replace the local PC copy of ArcCatalog.gx file with the common one.

Related Question