Created
July 28, 2014 08:20
-
-
Save jpluimers/3ddf9c1edd9ee39cc9bb to your computer and use it in GitHub Desktop.
Find an installed tf.exe, then run it with the command-line parameters specified.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
IF /I %PROCESSOR_ARCHITECTURE% == amd64 goto :x64 | |
IF /I %PROCESSOR_ARCHITEW6432% == amd64 goto :x64 | |
goto :x86 | |
:x64 | |
:: OS is 64bit | |
set vsBaseKey=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\ | |
goto :findTF | |
:x86 | |
:: OS is 32bit | |
set vsBaseKey=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\ | |
goto :findTF | |
:findTF | |
:: https://gist.github.com/rojepp/634908 | |
:: http://stackoverflow.com/questions/5369528/windows-batch-reg-query-key-value-to-a-variable-but-do-not-display-error-if-key | |
set SupportedVisualStudioVersions=8.0, 9.0, 10.0, 11.0, 12.0, 13.0 | |
for %%v in (%SupportedVisualStudioVersions%) do ( | |
for /f "usebackq tokens=2* delims= " %%c in (`reg query "%vsBaseKey%%%v" /v InstallDir 2^>NUL`) do ( | |
set tfExe=%%dtf.exe | |
) | |
) | |
if "%tfExe%"=="" ( echo no TF.exe found ) else ( | |
if not exist "%tfExe%" echo not found: "%tfExe%" | |
if exist "%tfExe%" "%tfExe%" %* | |
) | |
endlocal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment