<?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: ArcGIS Pro 3.0.1: How to run a python script by Windows “task scheduler”? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1209010#M59427</link>
    <description>&lt;P&gt;Right. It works like a charm. Thank you guys for the help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I fixed the source workspace and allowed overwriting as per the code below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-------------------------&lt;/P&gt;&lt;P&gt;# -*- coding: utf-8 -*-&lt;/P&gt;&lt;P&gt;"""&lt;/P&gt;&lt;P&gt;Generated by ArcGIS ModelBuilder on : 2022-09-02 06:56:18&lt;/P&gt;&lt;P&gt;"""&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;def Model():&amp;nbsp; # Buffer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # To allow overwriting outputs change overwriteOutput option to True.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.overwriteOutput = True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Model Environment settings&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.EnvManager(scratchWorkspace=r"C:\Z7\Q.gdb", workspace=r"C:\Z7\P.gdb"):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; L1 = "L1"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;# Process: Buffer (Buffer) (analysis)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; L1_Buffer = "C:\\Z7\\Q.gdb\\L1_Buffer"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.analysis.Buffer(in_features=L1, out_feature_class=L1_Buffer, buffer_distance_or_field="5 Meters", line_side="FULL", line_end_type="ROUND", dissolve_option="NONE", dissolve_field=[], method="PLANAR")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if __name__ == '__main__':&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Model()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the level of windows scheduler, I filled out the fllowing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Program\script:&lt;/P&gt;&lt;P&gt;c:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add Arguments&lt;/P&gt;&lt;P&gt;"c:\Z7\Buffer.py"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1188.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50221iDA73FAE32907BFA2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1188.jpg" alt="Clip_1188.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1189.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50222i6BE434B3F6CA11ED/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1189.jpg" alt="Clip_1189.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1190.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50223i739AD22B9DDDCD95/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1190.jpg" alt="Clip_1190.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1191.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50224i2079631C7D8BD38B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1191.jpg" alt="Clip_1191.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1192.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50225iAA06A974B81271AF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1192.jpg" alt="Clip_1192.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Sep 2022 04:43:38 GMT</pubDate>
    <dc:creator>JamalNUMAN</dc:creator>
    <dc:date>2022-09-02T04:43:38Z</dc:date>
    <item>
      <title>ArcGIS Pro 3.0.1: How to run a python script by Windows “task scheduler”?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208072#M59291</link>
      <description>&lt;P&gt;ArcGIS Pro 3.0.1: How to run a python script by Windows “task scheduler”?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the screenshot below, I wanted to run a python script that performs the buffer for a given feature class. I fill the “buffer.py” script in the “add argument” box but couldn’t figure out what to stick in the “Program/scrip” box&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1142.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49930iD70EAE2C68F686F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1142.jpg" alt="Clip_1142.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1143.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49931i0FC7DF5A0944C092/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1143.jpg" alt="Clip_1143.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1144.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49929i640C472FEC7E43D4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1144.jpg" alt="Clip_1144.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2022 08:51:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208072#M59291</guid>
      <dc:creator>JamalNUMAN</dc:creator>
      <dc:date>2022-08-31T08:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 3.0.1: How to run a python script by Windows “task scheduler”?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208095#M59297</link>
      <description>&lt;P&gt;The script (.py file) goes in the "program/script" box. You don't need any arguments!&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2022 10:53:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208095#M59297</guid>
      <dc:creator>RichardHowe</dc:creator>
      <dc:date>2022-08-31T10:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 3.0.1: How to run a python script by Windows “task scheduler”?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208112#M59303</link>
      <description>&lt;P&gt;Did you ever do this with ArcMap based python scripts?&amp;nbsp; If so, the only difference should be the path to python for ArcGIS Pro.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2022 12:26:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208112#M59303</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2022-08-31T12:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 3.0.1: How to run a python script by Windows “task scheduler”?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208227#M59317</link>
      <description>&lt;P&gt;It appears that sticking the python file in the "program/script" box doesn’t generate the expected feature class in the destination geodatabase (C:\Z7\Q.gdb)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What could be the issue here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1155.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49991iDAFE18C41F7E2660/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1155.jpg" alt="Clip_1155.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1153.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49988i0413A9C6D9EA5AB3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1153.jpg" alt="Clip_1153.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1154.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49990i468A987DD75FC437/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1154.jpg" alt="Clip_1154.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2022 15:20:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208227#M59317</guid>
      <dc:creator>JamalNUMAN</dc:creator>
      <dc:date>2022-08-31T15:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 3.0.1: How to run a python script by Windows “task scheduler”?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208646#M59379</link>
      <description>&lt;P&gt;Try copying and pasting the following into notepad:&lt;BR /&gt;&lt;BR /&gt;"c:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe" "c:\Z7\Buffer.py"&lt;BR /&gt;&lt;BR /&gt;And saving with a .bat extension. Then pointing task scheduler to that&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 13:10:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208646#M59379</guid>
      <dc:creator>RichardHowe</dc:creator>
      <dc:date>2022-09-01T13:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 3.0.1: How to run a python script by Windows “task scheduler”?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208777#M59395</link>
      <description>&lt;P&gt;The .bat file appears not to work as per the screenshots below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_30.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50157iBF01FF66EB25ED26/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_30.jpg" alt="Clip_30.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_31.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50158i5A7CEDE2F348AB90/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_31.jpg" alt="Clip_31.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_27.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50159i0EE9F92066155025/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_27.jpg" alt="Clip_27.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 16:57:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208777#M59395</guid>
      <dc:creator>JamalNUMAN</dc:creator>
      <dc:date>2022-09-01T16:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 3.0.1: How to run a python script by Windows “task scheduler”?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208778#M59396</link>
      <description>&lt;P&gt;Can you provide a screenshot of your bat file code?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 17:03:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208778#M59396</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2022-09-01T17:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 3.0.1: How to run a python script by Windows “task scheduler”?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208796#M59400</link>
      <description>&lt;P&gt;Sure. Here you go&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1180.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50166i5727E03841021093/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1180.jpg" alt="Clip_1180.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 17:38:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208796#M59400</guid>
      <dc:creator>JamalNUMAN</dc:creator>
      <dc:date>2022-09-01T17:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 3.0.1: How to run a python script by Windows “task scheduler”?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208797#M59401</link>
      <description>&lt;P&gt;I don't see anywhere that creates the C:\\Z7\\Q.gdb\\L1 feature class?&lt;/P&gt;&lt;P&gt;I see where you try to use it as an input feature class, but by the lack of arrow next to the Q.gdb, that would suggest the FGDB is empty (is there an existing L1 feature class in the Q.gdb?).&lt;/P&gt;&lt;P&gt;If not, the buffer tool can't use a non-existent dataset as an input.&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 17:39:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208797#M59401</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2022-09-01T17:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 3.0.1: How to run a python script by Windows “task scheduler”?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208813#M59407</link>
      <description>&lt;P&gt;All what I wanted here is to run the buffer tool by windows task scheduler. The python script is extracted from the model. It runs successfully thought the Pro as per the screenshots below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;------------------&lt;/P&gt;&lt;P&gt;# -*- coding: utf-8 -*-&lt;/P&gt;&lt;P&gt;"""&lt;/P&gt;&lt;P&gt;Generated by ArcGIS ModelBuilder on : 2022-08-31 11:41:53&lt;/P&gt;&lt;P&gt;"""&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;def Model():&amp;nbsp; # Buffer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # To allow overwriting outputs change overwriteOutput option to True.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.overwriteOutput = True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Model Environment settings&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.EnvManager(scratchWorkspace=r"C:\Z7\Q.gdb"):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; L1 = "L1"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Buffer (Buffer) (analysis)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; L1_Buffer = "C:\\Z7\\Q.gdb\\L1_Buffer"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.analysis.Buffer(in_features=L1, out_feature_class=L1_Buffer, buffer_distance_or_field="5 Meters", line_side="FULL", line_end_type="ROUND", dissolve_option="NONE", dissolve_field=[], method="PLANAR")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if __name__ == '__main__':&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Global Environment settings&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.EnvManager(workspace=r"C:\Users\jamal2\AppData\Local\Temp\ArcGISProTemp13328\3aee01c4-83fc-49dc-a1a9-1160767de7fc\Default.gdb"):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Model()&lt;/P&gt;&lt;P&gt;-------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why the script fails to run from the windows task scheduler?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1181.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50168i84F48DC7267587D6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1181.jpg" alt="Clip_1181.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1182.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50169i2F436487CF44B563/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1182.jpg" alt="Clip_1182.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1183.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50170i7C667A94BAE4AE93/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1183.jpg" alt="Clip_1183.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 18:16:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208813#M59407</guid>
      <dc:creator>JamalNUMAN</dc:creator>
      <dc:date>2022-09-01T18:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 3.0.1: How to run a python script by Windows “task scheduler”?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208824#M59410</link>
      <description>&lt;P&gt;Is L1 in P.gdb and your output buffer L1_buffer supposed to be created in Q.gdb?&amp;nbsp; If so, I don't see a reference to P.gdb for L1 in the standalone script.&amp;nbsp; The model might recognize L1 because you had it in the Pro project but the standalone script does not know this.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 18:38:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208824#M59410</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2022-09-01T18:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 3.0.1: How to run a python script by Windows “task scheduler”?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208839#M59411</link>
      <description>&lt;P&gt;In your map, you show L1 as coming from P.gdb in the datasource view so when you just refer to it as L1, Pro automatically makes a view layer called L1 for input (which when inside of Pro is P.gdb\L1).&amp;nbsp; You are setting a scratch workspace, but I still see nowhere that sets the actual path to the Q.gdb (even though I don't see L1 in there) or P.gdb database.&amp;nbsp; So, just using "L1" for input inside of Pro will be using the one from the P.dgb.&amp;nbsp; If ran outside of Pro, the script is not being told what input dataset to use.&lt;/P&gt;&lt;P&gt;Basically, if you run this as a stand alone script, you either need to specify the workspace/featureclass path that you want to use for input, or, use the arcpy.mp module to open the map, set map, dataframe, etc. then just using "L1" as your source layer will pick the one name L1 in the table of contents (from the P.gdb FGDB).&amp;nbsp; Otherwise, if stand alone, not inside of Pro, the script will not know what what dataset "L1" is.&lt;/P&gt;&lt;P&gt;Suspect if you replaced the line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;L1 = "L1" 
with
L1 = r"C:\Z7\P.gdb\L1" &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it will work both inside and outside of Pro.&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 19:05:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208839#M59411</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2022-09-01T19:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 3.0.1: How to run a python script by Windows “task scheduler”?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208863#M59415</link>
      <description>&lt;P&gt;Jamal:&lt;/P&gt;&lt;P&gt;In your model I would browse to the input data instead of using the input data from inside Pro in the dropdown list.&amp;nbsp; I believe when you then export the model to python, it will provide the full path to the input L1 feature class.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 19:39:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1208863#M59415</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2022-09-01T19:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 3.0.1: How to run a python script by Windows “task scheduler”?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1209010#M59427</link>
      <description>&lt;P&gt;Right. It works like a charm. Thank you guys for the help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I fixed the source workspace and allowed overwriting as per the code below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-------------------------&lt;/P&gt;&lt;P&gt;# -*- coding: utf-8 -*-&lt;/P&gt;&lt;P&gt;"""&lt;/P&gt;&lt;P&gt;Generated by ArcGIS ModelBuilder on : 2022-09-02 06:56:18&lt;/P&gt;&lt;P&gt;"""&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;def Model():&amp;nbsp; # Buffer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # To allow overwriting outputs change overwriteOutput option to True.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.overwriteOutput = True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Model Environment settings&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.EnvManager(scratchWorkspace=r"C:\Z7\Q.gdb", workspace=r"C:\Z7\P.gdb"):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; L1 = "L1"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;# Process: Buffer (Buffer) (analysis)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; L1_Buffer = "C:\\Z7\\Q.gdb\\L1_Buffer"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.analysis.Buffer(in_features=L1, out_feature_class=L1_Buffer, buffer_distance_or_field="5 Meters", line_side="FULL", line_end_type="ROUND", dissolve_option="NONE", dissolve_field=[], method="PLANAR")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if __name__ == '__main__':&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Model()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the level of windows scheduler, I filled out the fllowing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Program\script:&lt;/P&gt;&lt;P&gt;c:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add Arguments&lt;/P&gt;&lt;P&gt;"c:\Z7\Buffer.py"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1188.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50221iDA73FAE32907BFA2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1188.jpg" alt="Clip_1188.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1189.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50222i6BE434B3F6CA11ED/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1189.jpg" alt="Clip_1189.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1190.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50223i739AD22B9DDDCD95/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1190.jpg" alt="Clip_1190.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1191.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50224i2079631C7D8BD38B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1191.jpg" alt="Clip_1191.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clip_1192.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50225iAA06A974B81271AF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clip_1192.jpg" alt="Clip_1192.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2022 04:43:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-1-how-to-run-a-python-script-by/m-p/1209010#M59427</guid>
      <dc:creator>JamalNUMAN</dc:creator>
      <dc:date>2022-09-02T04:43:38Z</dc:date>
    </item>
  </channel>
</rss>

