<?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: Can you run a BAT (Batch) file using ArcPy? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245344#M66397</link>
    <description>&lt;P&gt;Can regular Python from&amp;nbsp;&lt;A href="https://www.python.org" target="_blank"&gt;https://www.python.org&lt;/A&gt;&amp;nbsp; be installed also when my server already has a "Python27" folder setup as Arcmap 10.8 is installed on this machine already.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jan 2023 16:56:31 GMT</pubDate>
    <dc:creator>CMcDonald</dc:creator>
    <dc:date>2023-01-04T16:56:31Z</dc:date>
    <item>
      <title>Can you run a BAT (Batch) file using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245311#M66391</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;is it possible to run a bat file using the version of Python (ArcPy) supplied with ArcGIS Pro 2.9 or ArcMap 10.8?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 16:01:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245311#M66391</guid>
      <dc:creator>CMcDonald</dc:creator>
      <dc:date>2023-01-04T16:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Can you run a BAT (Batch) file using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245320#M66394</link>
      <description>&lt;P&gt;You wouldn't use arcpy, you would use the &lt;A href="https://docs.python.org/3/library/subprocess.html" target="_self"&gt;subprocess module&lt;/A&gt;&amp;nbsp;built into Python.&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/a/5469427" target="_blank"&gt;https://stackoverflow.com/a/5469427&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 16:13:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245320#M66394</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2023-01-04T16:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can you run a BAT (Batch) file using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245322#M66395</link>
      <description>&lt;P&gt;You can run any program at all that you have permission to run on the computer. Here is a quick example.&lt;/P&gt;&lt;P&gt;&lt;A href="https://datatofish.com/batch-file-from-python/" target="_blank"&gt;https://datatofish.com/batch-file-from-python/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 16:15:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245322#M66395</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2023-01-04T16:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can you run a BAT (Batch) file using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245344#M66397</link>
      <description>&lt;P&gt;Can regular Python from&amp;nbsp;&lt;A href="https://www.python.org" target="_blank"&gt;https://www.python.org&lt;/A&gt;&amp;nbsp; be installed also when my server already has a "Python27" folder setup as Arcmap 10.8 is installed on this machine already.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 16:56:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245344#M66397</guid>
      <dc:creator>CMcDonald</dc:creator>
      <dc:date>2023-01-04T16:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Can you run a BAT (Batch) file using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245349#M66398</link>
      <description>&lt;P&gt;Installing ArcGIS (ArcMap or Pro) includes a full install of Python (2.x for ArcMap, 3.x for Pro). There's no need to install Python if you've already installed ArcGIS.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 17:02:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245349#M66398</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2023-01-04T17:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can you run a BAT (Batch) file using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245367#M66400</link>
      <description>&lt;P&gt;Are you trying to access python modules that are not installed by default during the installation of ArcMap or Pro?&lt;/P&gt;&lt;P&gt;Is this for the eventual goal of running a Windows Scheduled Task on a regular interval?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 17:59:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245367#M66400</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2023-01-04T17:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can you run a BAT (Batch) file using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245394#M66402</link>
      <description>&lt;P&gt;Example of sub process use:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import argparse
import os
import subprocess


parser = argparse.ArgumentParser(description='initialize electric trace weights')
parser.add_argument('--env', help='target environment: dev, test , or prod', default='dev')
args = parser.parse_args()
env = args.env
database = {'dev': 'dev', 'test': 'test', 'prod': 'prod'}[env]
working_dir = os.path.dirname(os.path.realpath(__file__))
password = xxxx
trace_weight_exe = os.path.join(working_dir, 'ElectricTraceWeightInit.exe')
command = '"{exe}" {db} {pw}'.format(exe=trace_weight_exe, db=database, pw=password)
process = subprocess.Popen(command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
						   stderr=subprocess.PIPE)
exit_code = process.wait()&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 04 Jan 2023 18:56:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245394#M66402</guid>
      <dc:creator>forestknutsen1</dc:creator>
      <dc:date>2023-01-04T18:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can you run a BAT (Batch) file using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245539#M66407</link>
      <description>&lt;P&gt;I would rather access python installed by ArcMap 10.8 if possible so that no additional software is required.&lt;/P&gt;&lt;P&gt;It won't be to run a Scheduled Task, the BAT I'm creating ultimately will trigger and FME Workspace to run but it has to be run on demand by the user as and when required.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 09:40:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245539#M66407</guid>
      <dc:creator>CMcDonald</dc:creator>
      <dc:date>2023-01-05T09:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can you run a BAT (Batch) file using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245665#M66410</link>
      <description>&lt;P&gt;Can you just have the user run the bat file from there desktops? Is the FME workspace and environment going to be on a server?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 16:55:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245665#M66410</guid>
      <dc:creator>forestknutsen1</dc:creator>
      <dc:date>2023-01-05T16:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can you run a BAT (Batch) file using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245678#M66411</link>
      <description>&lt;P&gt;Yes I think you are right, I have been having a similar thought myself.&amp;nbsp; Ultimately I will need to create a Python script, an ESRI Tool, a Geoprocessing Task and then add that to a WAB just to allow a nicer interface for the users.&lt;/P&gt;&lt;P&gt;I could probably just put the BAT file on a shared folder on the server and add permissions so they can run the FME workspace on the server.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 17:13:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-you-run-a-bat-batch-file-using-arcpy/m-p/1245678#M66411</guid>
      <dc:creator>CMcDonald</dc:creator>
      <dc:date>2023-01-05T17:13:40Z</dc:date>
    </item>
  </channel>
</rss>

