Run-time paths of script tools

Discussion created by ctilly on Aug 22, 2013
Latest reply on Sep 2, 2013 by Hornbydd
I've written a custom tool executable and I've added it to ArcGIS as a script tool using the method discussed here:

The tool reads from a config file located in the same directory as the executable. When ran manually from the command line this application works fine. However, once I run it as a script tool it fails because it can't find the config file, which it thinks is located in the same directory as ArcGIS in c:\Program Files.

What do I need to do to make it so that it reads the config file relative to where the executable resides and not relative to the host environment of the application housing the script process?

Many Thanks.