<?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: Run Python script through Windows Task Scheduler in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/run-python-script-through-windows-task-scheduler/m-p/532480#M41698</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If your scripts reference data on a network drive (like N:\folder\...), you will need to use the drive's UNC name (\\server\share\folder\...) instead.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 May 2012 14:01:45 GMT</pubDate>
    <dc:creator>BruceNielsen</dc:creator>
    <dc:date>2012-05-02T14:01:45Z</dc:date>
    <item>
      <title>Run Python script through Windows Task Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/run-python-script-through-windows-task-scheduler/m-p/532479#M41697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a number of Python scripts (exported models from Model Builder), which I would like to get run automatically at a particular time/day of the week. I had hoped I could run the scripts through MS Access so as to bundle them up with a number of other procedures that happen first there, and then schedule a basic MS Access macro to run through Windows Task Scheduler. Unfortunately, I have had limited success in getting the scripts to run through Access ShellWait. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would appreciate your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 12:09:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-python-script-through-windows-task-scheduler/m-p/532479#M41697</guid>
      <dc:creator>MathieuCain</dc:creator>
      <dc:date>2012-05-02T12:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Run Python script through Windows Task Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/run-python-script-through-windows-task-scheduler/m-p/532480#M41698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If your scripts reference data on a network drive (like N:\folder\...), you will need to use the drive's UNC name (\\server\share\folder\...) instead.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 14:01:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-python-script-through-windows-task-scheduler/m-p/532480#M41698</guid>
      <dc:creator>BruceNielsen</dc:creator>
      <dc:date>2012-05-02T14:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Run Python script through Windows Task Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/run-python-script-through-windows-task-scheduler/m-p/532481#M41699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;If your scripts reference data on a network drive (like N:\folder\...), you will need to use the drive's UNC name (\\server\share\folder\...) instead.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your reply. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I take it you are referring to changing the Local variables defined in the python script (previously exported from Model Builder). However, then what? Should I be creating a separate "master" script, which calls all of the other individual python scripts, and gets run in Windows Task Manager through something like "C:\Python26\ArcGIS10.0\python.exe" "\\servername\Data\MyDocumentPath\master.py" (i.e., Program/script: "C:\Python26\ArcGIS10.0\python.exe"; Add arguments (optional): "\\servername\Data\MyDocumentPath\master.py")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This would be as opposed to trying to find a way to include the scripts in an MS Access macro, run through a ShellWait.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 17:09:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-python-script-through-windows-task-scheduler/m-p/532481#M41699</guid>
      <dc:creator>MathieuCain</dc:creator>
      <dc:date>2012-05-02T17:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Run Python script through Windows Task Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/run-python-script-through-windows-task-scheduler/m-p/532482#M41700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would create a bat file such as this that would call the python script(s) that you created.&amp;nbsp; I have additional documentation that is sent to the log file to help indentify when each script is being run.&amp;nbsp; Just give it a file name such as Update.bat&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@echo off&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;echo Start time: %time% &amp;gt; update_data.log&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;echo ------------&amp;nbsp; Start time: %time%&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;echo ------------&amp;nbsp; Refreshing Database&amp;nbsp; -----------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;echo ------------&amp;nbsp; Refreshing Database&amp;nbsp; ----------------------- &amp;gt;&amp;gt; update_data.log&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;01_Data.py &amp;gt;&amp;gt; update_data.log&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;echo End time: %time%&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;echo&amp;nbsp; ' ' &amp;gt;&amp;gt; update_data.log&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;echo End time: %time% &amp;gt;&amp;gt; update_data.log&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;@echo on&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 17:28:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/run-python-script-through-windows-task-scheduler/m-p/532482#M41700</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2012-05-02T17:28:44Z</dc:date>
    </item>
  </channel>
</rss>

