Guest User

Python Auto Installer Batch Script

a guest
Apr 10th, 2023
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. Python Auto Installer (With pip and added to PATH)
  2.  
  3. 1. Copy the code below
  4.  
  5. @echo off
  6.  
  7. for /f "tokens=1,2 delims= " %%a in ('powershell -Command "Invoke-WebRequest https://www.python.org/ftp/python/ -UseBasicParsing | Select-String -Pattern '3.10.[0-9]{1,2}' -AllMatches | Select-Object -ExpandProperty Matches | Select-Object -ExpandProperty Value | Sort-Object -Descending -Unique | Select-Object -First 1"') do (
  8. set "PYTHON_VERSION=%%a%%b"
  9. )
  10. set "PYTHON_URL=https://www.python.org/ftp/python/%PYTHON_VERSION%/python-%PYTHON_VERSION%-amd64.exe"
  11. set "PYTHON_EXE=python-installer.exe"
  12.  
  13. curl -L -o %PYTHON_EXE% %PYTHON_URL%
  14.  
  15. start /wait %PYTHON_EXE% /quiet /passive InstallAllUsers=0 PrependPath=1 Include_test=0 Include_pip=1 Include_doc=0
  16.  
  17. del %PYTHON_EXE%
  18.  
  19. 2. Open a notepad, paste in that code
  20. 3. Save the file with a .bat extension and run it
  21.  
  22. Don't won't to do this?
  23. Download and run this file here: https://www.mediafire.com/file/wqd6yixn9r95ekc/Python_Installer.bat/file
Add Comment
Please, Sign In to add comment