<?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: Model Runs But Not When Exported to Python in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454425#M15299</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I had thought the fault is with the composition of the model rather than the script failing as I started to get locks from running the model direct as well as the scheduled task. Instead of overwriting the feature class I adjusted the model (after versioning the feature class in the Sde) to delete features/attributes then append the updated features/attributes then apply priviliges.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From looking at an other post on this thread you can determine if your model is failing or if your scheduled task is failing by opening the scheduled task properties, click the actions tab, highlight your task, click edit to show the path to your script eg: "\Python Scripts\YOURSCRIPT.py" then opening a command window, right click, paste then enter. This will run your python script - or any other .bat file etc directly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately I am still getting a (0x1) error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There was some advice from melanie about code;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;&lt;SPAN style="color:#333333;"&gt;import arcpy &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color:#333333;"&gt;arcpy.ImportToolbox(�??c:/mytools/geometrytools.tbx�?�, �??mytools�?�) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color:#333333;"&gt;arcpy.CreateRegularPolygons_mytools(parameter1, parameter2)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color:#333333;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but I am unsure where to add this code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Mar 2013 07:47:11 GMT</pubDate>
    <dc:creator>MarkYoung</dc:creator>
    <dc:date>2013-03-19T07:47:11Z</dc:date>
    <item>
      <title>Model Runs But Not When Exported to Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454416#M15290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a model which runs fine - tested OK. I wish to run this model once a week out of hours as a scheduled task on the server so I exported the model as a python script and added this script in as a scheduled task. For some reason it does not run giving me an error saying the table already exists. That is correct the table does exist and I wish to overwrite which the model does OK but the scheduled task fails.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Mar 2013 16:08:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454416#M15290</guid>
      <dc:creator>MarkYoung</dc:creator>
      <dc:date>2013-03-13T16:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Model Runs But Not When Exported to Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454417#M15291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Mark,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I suggest you take a look at this&lt;/SPAN&gt;&lt;A href="http://blogs.esri.com/esri/arcgis/2011/06/24/exportmodeltopy/"&gt; blog about exporting models to python&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You probably need to add the following to your script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.overwriteOutput = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Melanie S.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Mar 2013 17:01:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454417#M15291</guid>
      <dc:creator>MelanieSummers</dc:creator>
      <dc:date>2013-03-13T17:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Model Runs But Not When Exported to Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454418#M15292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mark:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you running the python script on a Windows Server (2003 or 2008, etc.)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If so, are you running it with highest privileges set?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If so, do you have it set to run whether user is logged on or not?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What version of ArcGIS Desktop do you have installed on the machine that you are running this scheduled task?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Under Action do you have Program/script set to the path of the python.exe file and under Add arguments do you have the path to the specific py file?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Mar 2013 17:17:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454418#M15292</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2013-03-13T17:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Model Runs But Not When Exported to Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454419#M15293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you both for your responses.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The server is windows 2008 R2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I added the code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;# Set overwrite to true&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;arcpy.env.overwriteOutput = True&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;to the top of the python file (presume you add at the top of the file)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also set the task to run with the highest privileges as suggested.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It runs whether the user logs in or not&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcGIS desktop 10.0 is installed on the server&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Within the scheduled task I have the action pointing to the .py file rather than a .exe&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is nothing in the arguments box pointing to a .py file&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Mar 2013 07:56:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454419#M15293</guid>
      <dc:creator>MarkYoung</dc:creator>
      <dc:date>2013-03-14T07:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: Model Runs But Not When Exported to Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454420#M15294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mark:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have any logging to determine at what point the script fails or if it even initiates?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You might also try creating a bat file to call from the scheduled task and then call the python script from the bat file.&amp;nbsp; This is especially useful if you want to run a series of python scripts one after the other.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Mar 2013 15:00:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454420#M15294</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2013-03-14T15:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Model Runs But Not When Exported to Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454421#M15295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mark,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you run the model using the following syntax, do you get the same error?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.ImportToolbox(�??c:/mytools/geometrytools.tbx�?�, �??mytools�?�) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CreateRegularPolygons_mytools(parameter1, parameter2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Melanie S.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Mar 2013 17:25:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454421#M15295</guid>
      <dc:creator>MelanieSummers</dc:creator>
      <dc:date>2013-03-14T17:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Model Runs But Not When Exported to Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454422#M15296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We're running into a very similar situation. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We started out exporting the model as a python script, which would fail. So we switched to using python to call the model and this particular model doesn't run to completion with that method. We have managed to call a smaller/shorter model successfully using python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The model that we want to run takes approximately 20 minutes to run when we run it by hand from ArcCatalog, but it doesn't run to completion when scheduled in Task Scheduler using python to call it. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We're using 10.1, 2008 R2&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2013 13:16:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454422#M15296</guid>
      <dc:creator>BrettWehs</dc:creator>
      <dc:date>2013-03-15T13:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Model Runs But Not When Exported to Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454423#M15297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Brett:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you know if your python script is even being initiated when run as a scheduled task?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you using any SDE connections?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you running the model itself on the 10.1 2008 R2 machine?&amp;nbsp; Or did you run the model on another machine and just try to run it as a scheduled task on the 10.1 2008 R2 machine?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2013 14:40:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454423#M15297</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2013-03-15T14:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Model Runs But Not When Exported to Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454424#M15298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Brett:&lt;BR /&gt;&lt;BR /&gt;Do you know if your python script is even being initiated when run as a scheduled task?&lt;BR /&gt;&lt;BR /&gt;--According to the Task Scheduler Summary the runs are succeeding, however they finish in about 5 minutes (the model run by hand is approx 20 minutes to completion) &lt;BR /&gt;&lt;BR /&gt;Are you using any SDE connections?&lt;BR /&gt;&lt;BR /&gt;-- Yes, the initial connections are SDE, it then exports the data to a staging File GDB and finally to a Personal GDB for export to be incorporated to the outside program&lt;BR /&gt;&lt;BR /&gt;Are you running the model itself on the 10.1 2008 R2 machine?&amp;nbsp; Or did you run the model on another machine and just try to run it as a scheduled task on the 10.1 2008 R2 machine?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;--Thanks for this insight, this is where my problem is (I think) The model runs fine on another machine, and when I schedule it the history tells me that it's run successfully, however it's not running to completion.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry for the delay in replying to this, I was trying a few different things to fix it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 17:15:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454424#M15298</guid>
      <dc:creator>BrettWehs</dc:creator>
      <dc:date>2013-03-18T17:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Model Runs But Not When Exported to Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454425#M15299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I had thought the fault is with the composition of the model rather than the script failing as I started to get locks from running the model direct as well as the scheduled task. Instead of overwriting the feature class I adjusted the model (after versioning the feature class in the Sde) to delete features/attributes then append the updated features/attributes then apply priviliges.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From looking at an other post on this thread you can determine if your model is failing or if your scheduled task is failing by opening the scheduled task properties, click the actions tab, highlight your task, click edit to show the path to your script eg: "\Python Scripts\YOURSCRIPT.py" then opening a command window, right click, paste then enter. This will run your python script - or any other .bat file etc directly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately I am still getting a (0x1) error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There was some advice from melanie about code;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;&lt;SPAN style="color:#333333;"&gt;import arcpy &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color:#333333;"&gt;arcpy.ImportToolbox(�??c:/mytools/geometrytools.tbx�?�, �??mytools�?�) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color:#333333;"&gt;arcpy.CreateRegularPolygons_mytools(parameter1, parameter2)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color:#333333;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but I am unsure where to add this code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 07:47:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454425#M15299</guid>
      <dc:creator>MarkYoung</dc:creator>
      <dc:date>2013-03-19T07:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Model Runs But Not When Exported to Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454426#M15300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Brett:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What kind of logging do you have in place to trap the error?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you sending e.Message via an E-mail alert or printing out e.Message to a log file?&amp;nbsp; I am using an E-mail alert that conatins e.Message in the BODY of the E-mail alert.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 14:07:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454426#M15300</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2013-03-19T14:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Model Runs But Not When Exported to Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454427#M15301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Mark,&lt;BR /&gt;&lt;BR /&gt;If you run the model using the following syntax, do you get the same error?&lt;BR /&gt;&lt;BR /&gt;import arcpy &lt;BR /&gt;arcpy.ImportToolbox(�??c:/mytools/geometrytools.tbx�?�, �??mytools�?�) &lt;BR /&gt;arcpy.CreateRegularPolygons_mytools(parameter1, parameter2)&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;Melanie S.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Still trying to get this working.. Do I simply add this code at the start of the script (changing "c:/mytools/geometrytools.tbx�?� �??mytools�?� to my own configuration..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 15:31:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454427#M15301</guid>
      <dc:creator>MarkYoung</dc:creator>
      <dc:date>2013-03-19T15:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Model Runs But Not When Exported to Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454428#M15302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have trawled numerous threads on the various issues calling a python script from a scheduled task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;To re-cap I have built a model, exported to python and can double click that python script to execute and all works OK - checked the feature class in ArcMap and the table has been updated as expected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However I cannot for the life of me get a scheduled task to work. I have tried calling the python direct from the scheduled task and creating a .bat file to call the python script &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I have done thus far..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Created the geo-processing model in ArcMap Model Builder 10.0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Created a new task within task scheduler (Windows server 2008 R2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Checked run whether user is logged in or out&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Checked run with highest privileges&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Under the actions tab I have selected start a program and the path to that program is "E:\PythonScripts\pytest.py" (Also tried swapping this for "C:\Python26\ArcGIS10.0"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Under Add Arguments I entered "E:\PythonScripts\pytest.py" &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start in Optional is blank&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried moving the toolbox and model to the C:\ in case there were any unforseen permission issues - no difference&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also had a look at &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/49702-Modelbuilder-to-Python-Glitch"&gt;http://forums.arcgis.com/threads/49702-Modelbuilder-to-Python-Glitch&lt;/A&gt;&lt;SPAN&gt; but that confused me a bit with the additional runtool.py script&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone got a scheduled task to call a python script?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If so, are you calling the exported python script direct or have you made a .bat file to call the python script - if so would you be kind enough to supply the code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2013 08:02:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454428#M15302</guid>
      <dc:creator>MarkYoung</dc:creator>
      <dc:date>2013-07-09T08:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Model Runs But Not When Exported to Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454429#M15303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I eventually solved this! (on win 2008 server)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When you are testing the scheduled task on the server and running the task on demand rather than a trigger click the radio button which says "Run only when the user is logged on"&amp;nbsp; Python script is executed and feature class updated. Click the radio button which says "Run whether the user is logged in or not" and add a trigger for a few minutes ahead (or whenever) then log off the server. Log back onto server to see a nice (0x0) task run successfully message.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://social.technet.microsoft.com/Forums/windows/en-US/c03d6691-b058-4f8d-961c-e8eba25bbaed/task-scheduler-problem-run-whether-user-is-logged-on-or-not"&gt;http://social.technet.microsoft.com/Forums/windows/en-US/c03d6691-b058-4f8d-961c-e8eba25bbaed/task-scheduler-problem-run-whether-user-is-logged-on-or-not&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jul 2013 15:10:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-runs-but-not-when-exported-to-python/m-p/454429#M15303</guid>
      <dc:creator>MarkYoung</dc:creator>
      <dc:date>2013-07-15T15:10:04Z</dc:date>
    </item>
  </channel>
</rss>

