<?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 Schedule Python script using windows task scheduler  in ArcGIS Workforce Questions</title>
    <link>https://community.esri.com/t5/arcgis-workforce-questions/schedule-python-script-using-windows-task/m-p/726038#M14</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Howdy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I modified a script following this blog post&amp;nbsp;&lt;A href="https://community.esri.com/thread/217644"&gt;Automatically generating assignments in Workforce&lt;/A&gt;. The script runs perfectly and I would like to schedule it to run at a specif time each day. To do this I have been following the blog post&amp;nbsp;&lt;A class="link-titled" href="https://www.esri.com/arcgis-blog/products/product/analytics/scheduling-a-python-script-or-model-to-run-at-a-prescribed-time/?rmedium=redirect&amp;amp;rsource=blogs.esri.com/esri/arcgis/2013/07/30/scheduling-a-scrip" title="https://www.esri.com/arcgis-blog/products/product/analytics/scheduling-a-python-script-or-model-to-run-at-a-prescribed-time/?rmedium=redirect&amp;amp;rsource=blogs.esri.com/esri/arcgis/2013/07/30/scheduling-a-scrip"&gt;Scheduling a Python script or model to run at a prescribed time&lt;/A&gt;.&amp;nbsp; I have been attempting this on a VM I created and installed anaconda and python on following this blog&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/python/guide/install-and-set-up/#Install-with-Anaconda" title="https://developers.arcgis.com/python/guide/install-and-set-up/#Install-with-Anaconda"&gt;Install and set up | ArcGIS for Developers&lt;/A&gt;. The script I am running was created on a note book. I then converted this to a .py file to run using task scheduler. The .py file calls for a password to be entered after running the file. I have tested the .py file on the vm by accessing the file through the anaconda prompt and running it from there. However I have had no success with running the script from the Task scheduler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me where I am going wrong?&amp;nbsp;&lt;A href="https://community.esri.com/t5/tag/aaron pulver/tg-p"&gt;#aaron pulver&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ACTIONS&lt;/P&gt;&lt;P&gt;Program/Script:&amp;nbsp;C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\python.exe&lt;/P&gt;&lt;P&gt;Add Arguments:&amp;nbsp;"C:\Users\Administrator\Documents\Workforce.py"-password=password&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Sep 2019 18:58:28 GMT</pubDate>
    <dc:creator>RobbieEisenrich</dc:creator>
    <dc:date>2019-09-23T18:58:28Z</dc:date>
    <item>
      <title>Schedule Python script using windows task scheduler</title>
      <link>https://community.esri.com/t5/arcgis-workforce-questions/schedule-python-script-using-windows-task/m-p/726038#M14</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Howdy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I modified a script following this blog post&amp;nbsp;&lt;A href="https://community.esri.com/thread/217644"&gt;Automatically generating assignments in Workforce&lt;/A&gt;. The script runs perfectly and I would like to schedule it to run at a specif time each day. To do this I have been following the blog post&amp;nbsp;&lt;A class="link-titled" href="https://www.esri.com/arcgis-blog/products/product/analytics/scheduling-a-python-script-or-model-to-run-at-a-prescribed-time/?rmedium=redirect&amp;amp;rsource=blogs.esri.com/esri/arcgis/2013/07/30/scheduling-a-scrip" title="https://www.esri.com/arcgis-blog/products/product/analytics/scheduling-a-python-script-or-model-to-run-at-a-prescribed-time/?rmedium=redirect&amp;amp;rsource=blogs.esri.com/esri/arcgis/2013/07/30/scheduling-a-scrip"&gt;Scheduling a Python script or model to run at a prescribed time&lt;/A&gt;.&amp;nbsp; I have been attempting this on a VM I created and installed anaconda and python on following this blog&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/python/guide/install-and-set-up/#Install-with-Anaconda" title="https://developers.arcgis.com/python/guide/install-and-set-up/#Install-with-Anaconda"&gt;Install and set up | ArcGIS for Developers&lt;/A&gt;. The script I am running was created on a note book. I then converted this to a .py file to run using task scheduler. The .py file calls for a password to be entered after running the file. I have tested the .py file on the vm by accessing the file through the anaconda prompt and running it from there. However I have had no success with running the script from the Task scheduler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me where I am going wrong?&amp;nbsp;&lt;A href="https://community.esri.com/t5/tag/aaron pulver/tg-p"&gt;#aaron pulver&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ACTIONS&lt;/P&gt;&lt;P&gt;Program/Script:&amp;nbsp;C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\python.exe&lt;/P&gt;&lt;P&gt;Add Arguments:&amp;nbsp;"C:\Users\Administrator\Documents\Workforce.py"-password=password&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2019 18:58:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-workforce-questions/schedule-python-script-using-windows-task/m-p/726038#M14</guid>
      <dc:creator>RobbieEisenrich</dc:creator>
      <dc:date>2019-09-23T18:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule Python script using windows task scheduler</title>
      <link>https://community.esri.com/t5/arcgis-workforce-questions/schedule-python-script-using-windows-task/m-p/726039#M15</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you try modifying the script where the password is embedded in the script so it does not need to be passed as an argument?&amp;nbsp; I'm just suggesting this idea to simplify your approach as a trouble-shooting step and not a final solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you been able to create other python scripts in the past that you run as a Windows Scheduled Task?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the operating system of your VM (e.g. Windows Server 2012, &lt;SPAN&gt;Windows Server 2016, etc.)&lt;/SPAN&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2019 19:06:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-workforce-questions/schedule-python-script-using-windows-task/m-p/726039#M15</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2019-09-23T19:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule Python script using windows task scheduler</title>
      <link>https://community.esri.com/t5/arcgis-workforce-questions/schedule-python-script-using-windows-task/m-p/726040#M16</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have added in the password to the script itself but I am still having no luck. The VM is windows server 2019 base&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my first time using the windows task scheduler to schedule a python script&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2019 19:18:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-workforce-questions/schedule-python-script-using-windows-task/m-p/726040#M16</guid>
      <dc:creator>RobbieEisenrich</dc:creator>
      <dc:date>2019-09-23T19:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule Python script using windows task scheduler</title>
      <link>https://community.esri.com/t5/arcgis-workforce-questions/schedule-python-script-using-windows-task/m-p/726041#M17</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Howdy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if this helps but here are screen shots from attempting to run the .py in windows command line vs anaconda command&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/460261_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;As you can see the .py fails in the windows and works in the anaconda prompt. I would run it in the python command line but am unable to find where the python command line is.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2019 21:00:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-workforce-questions/schedule-python-script-using-windows-task/m-p/726041#M17</guid>
      <dc:creator>RobbieEisenrich</dc:creator>
      <dc:date>2019-09-23T21:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule Python script using windows task scheduler</title>
      <link>https://community.esri.com/t5/arcgis-workforce-questions/schedule-python-script-using-windows-task/m-p/726042#M18</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Howdy!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to solve the issue. I killed the VM launched another and went through the steps again. This for some reason worked and I am now able to schedule the script at different intervals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks guys!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Sep 2019 01:31:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-workforce-questions/schedule-python-script-using-windows-task/m-p/726042#M18</guid>
      <dc:creator>RobbieEisenrich</dc:creator>
      <dc:date>2019-09-24T01:31:21Z</dc:date>
    </item>
  </channel>
</rss>

