@echo off setlocal enabledelayedexpansion REM Specify the Python version REM Version for embeded windows package from: https://www.python.org/downloads/windows/ set PYTHON_VERSION=3.11.7 set PTH_File_Version=311 REM Download and extract Python powershell wget https://www.python.org/ftp/python/%PYTHON_VERSION%/python-%PYTHON_VERSION%-embed-amd64.zip -o python-%PYTHON_VERSION%-embed-amd64.zip powershell Expand-Archive python-%PYTHON_VERSION%-embed-amd64.zip REM Move and create necessary directories move python-%PYTHON_VERSION%-embed-amd64 portable_python mkdir portable_python\DLLs REM Download get-pip.py powershell wget https://bootstrap.pypa.io/get-pip.py -o portable_python\get-pip.py set "file=portable_python\python%PTH_File_Version%._pth" ( echo .\Lib echo .\Lib\site-packages type "%file%" ) > "%file%.new" move /y "%file%.new" "%file%" REM setx PATH "%PATH%;%~dp0portable_python;%~dp0portable_python\Scripts" REM Install pip .\portable_python\python.exe .\portable_python\get-pip.py .\portable_python\python.exe -m pip install -r .\requirements.txt .\portable_python\python.exe scanner.py del python-%PYTHON_VERSION%-embed-amd64.zip PAUSE endlocal