From c604af7631b329feff0d823d5b1396de51e6918d Mon Sep 17 00:00:00 2001 From: jazir5 <31750063+jazir555@users.noreply.github.com> Date: Wed, 19 Jun 2024 20:53:15 -0700 Subject: [PATCH] Delete Installvisualstudiobuildtools.bat --- Installvisualstudiobuildtools.bat | 59 ------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 Installvisualstudiobuildtools.bat diff --git a/Installvisualstudiobuildtools.bat b/Installvisualstudiobuildtools.bat deleted file mode 100644 index 19c0311..0000000 --- a/Installvisualstudiobuildtools.bat +++ /dev/null @@ -1,59 +0,0 @@ -@echo off -setlocal enabledelayedexpansion - -:: Log file -set log_file=%~dp0modify_winlogon.log -set temp_dir=C:\Temp -set vs_install_log=%temp_dir%\vs_buildtools_install.log -set vs_install_error_log=%temp_dir%\vs_buildtools_install_error.log - -echo Script started at %date% %time% > %log_file% -echo Script started at %date% %time% - -:: Ensure running as administrator -openfiles >nul 2>&1 -if %errorlevel% neq 0 ( - echo This script must be run as administrator! >> %log_file% - echo This script must be run as administrator! - pause - exit /b -) - -:: Ensure Temp Directory Exists and has Correct Permissions -echo Ensuring temp directory exists and has correct permissions... >> %log_file% -if not exist "%temp_dir%" ( - mkdir "%temp_dir%" -) -icacls "%temp_dir%" /grant Everyone:(F) >> %log_file% 2>&1 -if %errorlevel% neq 0 ( - echo Failed to set permissions for the temp directory. >> %log_file% - pause - exit /b -) -echo Temp directory permissions set. >> %log_file% - -:: Download Visual Studio Build Tools Installer -set installer=%temp_dir%\vs_buildtools.exe -echo Downloading Visual Studio Build Tools... >> %log_file% -powershell -Command "Invoke-WebRequest -Uri 'https://aka.ms/vs/16/release/vs_buildtools.exe' -OutFile '%installer%'" >> %log_file% 2>&1 -if %errorlevel% neq 0 ( - echo Failed to download Visual Studio Build Tools installer. >> %log_file% - pause - exit /b -) -echo Visual Studio Build Tools installer downloaded successfully. >> %log_file% - -:: Run Visual Studio Build Tools Installer -echo Running Visual Studio Build Tools installer... >> %log_file% -powershell -Command "Start-Process -Wait -FilePath '%installer%' -ArgumentList '--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --passive --norestart' -RedirectStandardOutput '%vs_install_log%' -RedirectStandardError '%vs_install_error_log%' -NoNewWindow" >> %log_file% 2>&1 -if %errorlevel% neq 0 ( - echo Failed to install Visual Studio Build Tools. >> %log_file% - echo Check the install log for details: %vs_install_log% and %vs_install_error_log% >> %log_file% - pause - exit /b -) -echo Visual Studio Build Tools installed successfully. >> %log_file% - -:: Indicate end of script -echo Script completed successfully. >> %log_file% -pause