How to install Python using Windows Command Prompt

Solution 1:

https://docs.python.org/3.6/using/windows.html#installing-without-ui

Installing Without UI: All of the options available in the installer UI can also be specified from the command line, allowing scripted installers to replicate an installation on many machines without user interaction. These options may also be set without suppressing the UI in order to change some of the defaults.

To completely hide the installer UI and install Python silently, pass the /quiet option. To skip past the user interaction but still display progress and errors, pass the /passive option. The /uninstall option may be passed to immediately begin removing Python - no prompt will be displayed.

All other options are passed as name=value, where the value is usually 0 to disable a feature, 1 to enable a feature, or a path.

Solution 2:

For Windows

I was unable to find a way to Download python using just CMD but if you have python.exe in your system then you can use the below Method to install it (you can also make .bat file to automate it.)

  1. Download the python.exe file on your computer from the official site.

  2. Open CMD and change Your directory to the path where you have python.exe

  3. Past this code in your Command prompt make sure to change the name with your file version In the below code(e.g python-3.8.5.exe)

python-3.6.0.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0

It will also set the path Variables.