<?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: Checking System Information to set ArcToolbox Paths? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463069#M36276</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I don't think you need to use AddToolbox for standard toolboxes.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Exactly, there's no need to set anything for standard toolboxes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've never put those in any scripts.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Oct 2011 23:19:34 GMT</pubDate>
    <dc:creator>RDHarles</dc:creator>
    <dc:date>2011-10-03T23:19:34Z</dc:date>
    <item>
      <title>Checking System Information to set ArcToolbox Paths?</title>
      <link>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463061#M36268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to find a way to check my computer system information in order to set correct paths to the Arctoolbox using the older geoprocessor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have 2 computers:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One is my Windows XP Pro 32bit OS (version 5.1.2600). &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The second is a Windows 7 64bit OS (version 6.1.7601). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to do a system check in order to set the correct path to ArcToolbox before the script continues to process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I thought the following script would do this for me, but when I run it on the second computer (the second if statement or the windows 7 computer) I get a fatal error and ArcCatalogue closes. If I ran it on the first computer, the script runs find. If I were to reverse the if statements, the second computer will always crash in a fatal error. I've used an elif for the second computer, same result. I used an "else: pass" in the first statement, I get the same error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I figured there should be an easy way to do a system check for the new Programs (x86) system path, but I'm not sure how to do it. Any suggestions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcgisscripting, sys, platform
# Create the geoprocessor object
gp = arcgisscripting.create()

### Load required toolboxes...
##gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes/Data Management Tools.tbx")
##gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes/Analysis Tools.tbx")
# Load required toolboxes (Win7)

if platform.version() == '5.1.2600':
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Data Management Tools.tbx")
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Analysis Tools.tbx")

if platform.version() == '6.1.7601':
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbox("C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Data Management Tools.tbx")
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbos("C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Analysis Tools.tbx")
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2011 17:53:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463061#M36268</guid>
      <dc:creator>MikeMacRae</dc:creator>
      <dc:date>2011-10-03T17:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Checking System Information to set ArcToolbox Paths?</title>
      <link>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463062#M36269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I use this&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
username = getpass.getuser()
if platform.version()[0] == "6":
&amp;nbsp;&amp;nbsp;&amp;nbsp; #Check if Windows 7
&amp;nbsp;&amp;nbsp;&amp;nbsp; sde = "C:\Users\\"+username+"\\AppData\\Roaming\\ESRI\\Desktop10.0\\ArcCatalog\\wisprod.sde"
elif platform.version()[0] == "5":
&amp;nbsp;&amp;nbsp;&amp;nbsp; #Check if Windows XP
&amp;nbsp;&amp;nbsp;&amp;nbsp; sde = r"C:\Documents and Settings\\"+username+"\Application Data\ESRI\ArcCatalog\wisprod.sde"

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "SDE connection found, continuing"
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "User &amp;lt;"+username+"&amp;gt; is invalid, not found, or you do not have access to SDE."
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:34:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463062#M36269</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-11T20:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Checking System Information to set ArcToolbox Paths?</title>
      <link>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463063#M36270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey Matt,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried your script and edited as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
if platform.version()[0] == "6":
&amp;nbsp;&amp;nbsp;&amp;nbsp; #Check if Windows 7
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbox("C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Data Management Tools.tbx")
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbos("C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Analysis Tools.tbx")
elif platform.version()[0] == "5":
&amp;nbsp;&amp;nbsp;&amp;nbsp; #Check if Windows XP
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Data Management Tools.tbx")
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Analysis Tools.tbx")

&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Connection found, continuing"
else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; "No connection."
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm still getting a fatal error. I've also tried this and I'm getting a fatal error as well. I'm not sure what's causing it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if arcpy.Exists("C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbox("C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Data Management Tools.tbx")
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbos("C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Analysis Tools.tbx")
elif arcpy.Exists("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Data Management Tools.tbx")
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbox("C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Analysis Tools.tbx")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:34:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463063#M36270</guid>
      <dc:creator>MikeMacRae</dc:creator>
      <dc:date>2021-12-11T20:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Checking System Information to set ArcToolbox Paths?</title>
      <link>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463064#M36271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you try this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if platform.version()[0] == "6":
&amp;nbsp;&amp;nbsp;&amp;nbsp; #Check if Windows 7
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbox(&lt;STRONG&gt;r&lt;/STRONG&gt;"C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Data Management Tools.tbx")
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbos(&lt;STRONG&gt;r&lt;/STRONG&gt;"C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Analysis Tools.tbx")
elif platform.version()[0] == "5":
&amp;nbsp;&amp;nbsp;&amp;nbsp; #Check if Windows XP
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbox(&lt;STRONG&gt;r&lt;/STRONG&gt;"C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Data Management Tools.tbx")
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbox(&lt;STRONG&gt;r&lt;/STRONG&gt;"C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Analysis Tools.tbx")

&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Connection found, continuing"
else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; "No connection."&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:34:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463064#M36271</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-11T20:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Checking System Information to set ArcToolbox Paths?</title>
      <link>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463065#M36272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Wow, what a whirlwind this one was. I spent all day trying to troubleshoot this and I noticed my problem. If you see the examples I posted above, one of my gp.ArcToolbox syntaxes had one of them spelled 'ArcToolbos'. This created a fatal error and closed ArcCatalogue/ArcMap every time I ran it. I'm not used to fatal errors for simple spelling mistakes. Usually I get a python error/message. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyways, the logic was working, apparently my brain wasn't. Thanks for the scripts Matt. I have a&amp;nbsp; number of old scripts to set up this way, so your examples may come useful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2011 19:43:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463065#M36272</guid>
      <dc:creator>MikeMacRae</dc:creator>
      <dc:date>2011-10-03T19:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Checking System Information to set ArcToolbox Paths?</title>
      <link>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463066#M36273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Glad I could be of help. Those kind of errors are tough to track down if you don't get a helpful error message.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2011 20:20:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463066#M36273</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2011-10-03T20:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Checking System Information to set ArcToolbox Paths?</title>
      <link>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463067#M36274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;you can also use &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.GetInstallInfo("desktop")["InstallDir"]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;look at &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000003s000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000003s000000&lt;/A&gt;&lt;SPAN&gt; for the complete documentation&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ciao,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AC&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2011 20:22:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463067#M36274</guid>
      <dc:creator>AlessandroCinnirella</dc:creator>
      <dc:date>2011-10-03T20:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Checking System Information to set ArcToolbox Paths?</title>
      <link>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463068#M36275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't think you need to use AddToolbox for standard toolboxes.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2011 20:46:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463068#M36275</guid>
      <dc:creator>LoganPugh</dc:creator>
      <dc:date>2011-10-03T20:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Checking System Information to set ArcToolbox Paths?</title>
      <link>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463069#M36276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I don't think you need to use AddToolbox for standard toolboxes.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Exactly, there's no need to set anything for standard toolboxes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've never put those in any scripts.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2011 23:19:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/checking-system-information-to-set-arctoolbox/m-p/463069#M36276</guid>
      <dc:creator>RDHarles</dc:creator>
      <dc:date>2011-10-03T23:19:34Z</dc:date>
    </item>
  </channel>
</rss>

