<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ArcGIS profile installation directories in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcgis-profile-installation-directories/m-p/3922#M336</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I had thought there would be some behind the curtain voodoo that could be accessed to go directly to the CustomTransformations folder, since whenever you use the Project tool with valid parameters the custom transformation will come up as an option. So somewhere out there is a CustomTransformation folder variable, but I guess it isn't accessible.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Feb 2012 19:44:52 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2012-02-23T19:44:52Z</dc:date>
    <item>
      <title>ArcGIS profile installation directories</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-profile-installation-directories/m-p/3917#M331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does anyone know of a way to dynamically find the ArcGIS profile directory without having to code each in explicitly with an if/else? Specifically, I am trying to access the Custom Transformations folder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, I have 9.3.1 on Windows XP or 10.0 on Windows 7 and test doing something like the following&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;if windows[0] == "6": &amp;nbsp;&amp;nbsp;&amp;nbsp; trans_dir = os.getenv("USERPROFILE") +os.sep+ r"AppData\Roaming\ESRI\Desktop10.0\ArcToolbox\CustomTransformations" elif windows[0] == "5": &amp;nbsp;&amp;nbsp;&amp;nbsp; trans_dir = os.getenv("USERPROFILE") +os.sep+ r"Application Data\ESRI\ArcToolbox\CustomTransformations"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But also may run into situations where there is 9.3.1 on Windows 7, or 10.0 on Windows XP. Putting each possibility in seems rather sloppy. Is there a cleaner way to go about this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 17:50:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-profile-installation-directories/m-p/3917#M331</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-02-22T17:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS profile installation directories</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-profile-installation-directories/m-p/3918#M332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How about: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.GetSystemEnvironment("APPDATA")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;os.getenv("APPDATA")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and then sort out the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ESRI\Desktop10.0\ArcToolbox\CustomTransformations&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ESRI\ArcToolbox\CustomTransformations&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;using&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.GetInstallInfo("DESKTOP")['Version']&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.GetInstallInfo("DESKTOP")['Version']&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 19:32:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-profile-installation-directories/m-p/3918#M332</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2012-02-22T19:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS profile installation directories</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-profile-installation-directories/m-p/3919#M333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That makes it much easier to read, thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 18:31:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-profile-installation-directories/m-p/3919#M333</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-02-23T18:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS profile installation directories</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-profile-installation-directories/m-p/3920#M334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's some reusable code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
import os
def ArcGISProfile(profilePath=None):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """ArcGIS Windows user profile path"""
&amp;nbsp;&amp;nbsp;&amp;nbsp; APPDATA = arcpy.GetSystemEnvironment("APPDATA")
&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.GetInstallInfo("DESKTOP")['Version'].find("10") == -1:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; path = os.path.join(APPDATA,"ESRI")
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; path = os.path.join(APPDATA,"ESRI/Desktop10.0/")
&amp;nbsp;&amp;nbsp;&amp;nbsp; return os.path.realpath(os.path.join(path,profilePath))

print ArcGISProfile("ArcToolbox\CustomTransformations")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This returns (on XP):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;C:\Documents and Settings\cprice\Application Data\ESRI\Desktop10.0\ArcToolbox\CustomTransformations&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:09:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-profile-installation-directories/m-p/3920#M334</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-10T20:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS profile installation directories</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-profile-installation-directories/m-p/3921#M335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Still doesn't get rid of the need for the conditional statement though... That said, I don't think there is a way to "directly" get the path you are looking for.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This might be handy: &lt;/SPAN&gt;&lt;A href="http://en.wikipedia.org/wiki/Environment_variable#Default_Values_on_Microsoft_Windows"&gt;http://en.wikipedia.org/wiki/Environment_variable#Default_Values_on_Microsoft_Windows&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 19:40:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-profile-installation-directories/m-p/3921#M335</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2012-02-23T19:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS profile installation directories</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-profile-installation-directories/m-p/3922#M336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I had thought there would be some behind the curtain voodoo that could be accessed to go directly to the CustomTransformations folder, since whenever you use the Project tool with valid parameters the custom transformation will come up as an option. So somewhere out there is a CustomTransformation folder variable, but I guess it isn't accessible.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Feb 2012 19:44:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-profile-installation-directories/m-p/3922#M336</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-02-23T19:44:52Z</dc:date>
    </item>
  </channel>
</rss>

