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?
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
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.
I have used this link HERE before to create a connection on my c:\temp folder. I would think you could use it in your "Database Connections" folder. The "Database Connections" folder for 10.0 is at: C:\Users\USERNAME\AppData\Roaming\ESRI\Desktop10.0\ArcCatalog, I would guess it is somewhere similar for 10.1
Someone above said: """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."""
With a symlink (if that works the same as on *nix, I'm not entirely convinced when it comes to this Redmond system) you should be able to store an original .gx file in one location, and create a symlink to it, and then copy that symlink to whatever locations you desire and they all should use the same settings.
mklink link_name //path/whatever.ext
A symlink should to the system be indistinguishable from the original. That's the point with a symlink. (NOTE: symlink != shortcut) Whether or not ArcCatalog will choke on it when one copy changes the settings while another is reading it, is a whole other can'o'worms. Don't blame me if this info fries your database or your computer or leads your kids astray or gives you a sore toe or makes your pets run away!