Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Ashutoshkumargautam/b631bf5d010baad167153b11f49e5c5b to your computer and use it in GitHub Desktop.
Save Ashutoshkumargautam/b631bf5d010baad167153b11f49e5c5b to your computer and use it in GitHub Desktop.
This is Code install python but one click
@echo off
set PYTHON_URL=https://www.python.org/ftp/python/3.9.7/python-3.9.7-amd64.exe
rem Step 1: Download Python installer
echo Downloading Python installer...
curl -L -o python_installer.exe %PYTHON_URL%
rem Step 2: Install Python
echo Installing Python...
python_installer.exe /quiet /passive
rem Step 3: Check if installation was successful
python --version >nul 2>nul
if errorlevel 1 (
echo Installation failed. Attempting to fix...
rem Try reinstalling Python
python_installer.exe /quiet /passive
rem Check again after reinstall
python --version >nul 2>nul
if errorlevel 1 (
echo Failed to install Python. Please install it manually.
exit /b 1
) else (
echo Python reinstalled successfully.
)
) else (
echo Python installed successfully.
)
rem Clean up - remove the installer
del python_installer.exe
echo Installation and setup completed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment