Skip to content

Instantly share code, notes, and snippets.

@Algo-ryth-mix
Created February 23, 2021 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Algo-ryth-mix/11dd9235f79e677ca260427e3df7003c to your computer and use it in GitHub Desktop.
Save Algo-ryth-mix/11dd9235f79e677ca260427e3df7003c to your computer and use it in GitHub Desktop.
vs-exec.bat
@echo off
rem Allows to call commands as if it was a vs-prompt by preceeding it with vs-exec
rem For instance `vs-exec cl main.cpp` to compile `main.cpp`
IF NOT DEFINED VS_BASE_PATH (
FOR /F "tokens=*" %%g IN ('vswhere -latest -property "installationPath"') do (SET VS_BASE_PATH=%%g)
)
IF NOT DEFINED IS_DEVENV (
@call "%VS_BASE_PATH%\Common7\Tools\vsdevcmd.bat" -arch=x64 /no_logo && SET IS_DEVENV=1
)
%*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment