<?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: Python &amp;amp;  Windows Task Scheduler in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53111#M4203</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When you created a new scheduled task, did you check the "Wake Computer Up to Run this task" box under the settings tab?&amp;nbsp; Also, when you create a .bat file, how did you set up?&amp;nbsp; I usually just set up batch files by opening up notepad and just putting something like this in and saving it as .bat file:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
start G:\Misc\Scripts\Backup_mdb.py
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;OR&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you can just navigate to your .py file on the Run: line under the task tab.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]18064[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 22:02:38 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-10T22:02:38Z</dc:date>
    <item>
      <title>Python &amp;amp;  Windows Task Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53110#M4202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have created a python script and am using Windows 7 Task Scheduler because I want it to run daily. It runs fine if I run it manually or 'Run only when user is logged on'. I am running into trouble when I choose 'Run only whether user is logged on or not'. I have read several form entries and have employed the following solutions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Changed all paths to UNC paths in my python script&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Put it into a .Bat file&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have a solution to this? This seems like it should be so simple.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;~Stephanie Patterson&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2012 21:07:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53110#M4202</guid>
      <dc:creator>StephaniePatterson</dc:creator>
      <dc:date>2012-09-27T21:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Python &amp;  Windows Task Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53111#M4203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When you created a new scheduled task, did you check the "Wake Computer Up to Run this task" box under the settings tab?&amp;nbsp; Also, when you create a .bat file, how did you set up?&amp;nbsp; I usually just set up batch files by opening up notepad and just putting something like this in and saving it as .bat file:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
start G:\Misc\Scripts\Backup_mdb.py
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;OR&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you can just navigate to your .py file on the Run: line under the task tab.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]18064[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:02:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53111#M4203</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-10T22:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Python &amp;  Windows Task Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53112#M4204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I found 'Wake the computer to run this task" under the Conditions Tab and I checked that on. What I have in my .bat file looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;start I:\GIS\ArcGISServer\Probation\Updates_Daily\PythonScripts\GeocortexDailyUpdate_new.py&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I ran it with 'Run whether user is logged on or not' to no success. It just keeps running without completing like it would if I had is set to 'Run only when user is logged on'. Any other ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2012 15:25:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53112#M4204</guid>
      <dc:creator>StephaniePatterson</dc:creator>
      <dc:date>2012-09-28T15:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Python &amp;  Windows Task Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53113#M4205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;can you try running the script directly rather than from a bat? we run a number of scripts that fire as frequently as ever 5 minutes up to an hour or just once a day, and the tasks are refered to directly and run just fine.&amp;nbsp; To do this, when you are editing the Actions that are carried out by the task under the Action drop down, select 'Start a program' and under the settings, where it is asking for the program or script to run we have 'C:\Python26\ArcGIS10.0\pythonw.exe' and then the script path/file name is supplied in the text box that asks for arguments. See the attached image.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2012 16:05:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53113#M4205</guid>
      <dc:creator>ChristopherThompson</dc:creator>
      <dc:date>2012-09-28T16:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: Python &amp;  Windows Task Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53114#M4206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I changed to run the python script itself. It runs but then completes like in 2 seconds not running my script but says it ran successfully, but it didnt.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2012 16:30:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53114#M4206</guid>
      <dc:creator>StephaniePatterson</dc:creator>
      <dc:date>2012-09-28T16:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Python &amp;  Windows Task Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53115#M4207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is a bat file I have that runs the .py script below and includes writing to a log file from both the bat file and the py script.&amp;nbsp; You should also check Run with highest privileges:&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; Road_Index_Update.log&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;echo ------------&amp;nbsp; Update time: %time%&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;echo ------------&amp;nbsp; Create Road Index&amp;nbsp; -------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;echo ------------&amp;nbsp; Create Road Index&amp;nbsp; ------------- &amp;gt;&amp;gt; Road_Index_Update.log&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Feature_Class_for_Road_Index.py &amp;gt;&amp;gt; Road_Index_Update.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; Road_Index_Update.log&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;echo End time: %time% &amp;gt;&amp;gt; Road_Index_Update.log&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;@echo on&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2012 18:34:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53115#M4207</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2012-09-28T18:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: Python &amp;  Windows Task Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53116#M4208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am running into the same problem as the OP ... I cannot get a python script to run with Windows 7 Task Scheduler when I check 'Run only whether user is logged on or not' ... however, the script will run perfectly fine when 'Run only when user is logged on' is checked.&amp;nbsp; Also, checking 'Run with highest privileges' seems to have no effect.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This has got me stumped...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As the OP has already mentioned, it seems like the remedy to this problem should be something easy...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2012 18:49:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53116#M4208</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-10-03T18:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Python &amp;  Windows Task Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53117#M4209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would add a little tweak to capture the error messages if any. Also, the way to enter a blank line - no quotes is: "echo.":&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
@echo off
echo Start time: %time% &amp;gt; Road_Index_Update.log
echo ------------&amp;nbsp; Update time: %time%
echo ------------&amp;nbsp; Create Road Index&amp;nbsp; -------------
echo ------------&amp;nbsp; Create Road Index&amp;nbsp; ------------- &amp;gt;&amp;gt; Road_Index_Update.log
Feature_Class_for_Road_Index.py &amp;gt;&amp;gt; Road_Index_Update.log &lt;SPAN style="color:red;"&gt;2&amp;gt;&amp;amp;1&lt;/SPAN&gt; 
echo End time: %time%
echo. &amp;gt;&amp;gt; Road_Index_Update.log
echo End time: %time% &amp;gt;&amp;gt; Road_Index_Update.log
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The issue of things not working when not logged in may be a Windows permissions setting. (That's why it was suggested you run at the highest permission account you have access to.)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:02:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53117#M4209</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-10T22:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Python &amp;  Windows Task Scheduler</title>
      <link>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53118#M4210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I find checking 'Run with highest privileges' needs to be checked on Windows 7 for scheduled tasks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2012 10:18:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-amp-amp-nbsp-windows-task-scheduler/m-p/53118#M4210</guid>
      <dc:creator>AndrewChapkowski</dc:creator>
      <dc:date>2012-10-05T10:18:14Z</dc:date>
    </item>
  </channel>
</rss>

