Problem: Unable to execute a python file in Windows Command Prompt
Description
Attempts to execute a python file in Windows Command Prompt fail, and the following error message is returned:
Error: This app can't run on your PC. To find a version for your PC, check with the software publisher.

Cause
The python.exe file is corrupted, as it has a file size of 0kb. Windows executable files cannot be 0kb in size.
Solution or Workaround
Download and reinstall the python.exe file. The necessary Python version is listed in the knowledge base article, FAQ: What version of Python is used in ArcGIS?, and the python.exe file can be downloaded from Python: Download the latest version. The default location for the python.exe file depends on the version, as demonstrated below.
- Python 2.7
C:\Python27\ArcGIS10.x
- Python 3.x for ArcGIS Enterprise 10.8.x and below
C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3
- Python 3.x for ArcGIS Enterprise 10.9.x
C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\Scripts\propy.bat
Related Information
Last Published: 12/20/2021
Article ID: 000026993
Software: ArcGIS Server 10.9.1, 10.9, 10.8.1, 10.8, 10.7.1, 10.7