Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal
- :: Path to the Visual Studio vcvars64.bat
- set "VCVARS64_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
- :: Check if the VC vars batch file exists
- if not exist "%VCVARS64_PATH%" (
- echo Error: Visual Studio 2022 Build Tools vcvars64.bat not found.
- exit /b 1
- )
- :: Initialize Visual Studio Build Tools environment
- call "%VCVARS64_PATH%" >nul 2>&1
- :: Prompt user to enter the code folder path
- echo Please enter the full path to your code folder:
- set /p CODEFOLDER="Path: "
- set "CONCAT=%USERPROFILE%\Visual Studio Code\"
- :: Check if the directory exists
- if not exist "%CONCAT%%CODEFOLDER%" (
- echo Error: The specified folder does not exist.
- exit /b 1
- )
- :: Change to the specified directory
- cd /d "%CONCAT%%CODEFOLDER%"
- :: Open Visual Studio Code in the directory
- code .
- :: End of script
- endlocal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement