Skip to content

Instantly share code, notes, and snippets.

@jpluimers jpluimers/tf.bat
Created Jul 28, 2014

What would you like to do?
Find an installed tf.exe, then run it with the command-line parameters specified.
@echo off
IF /I %PROCESSOR_ARCHITECTURE% == amd64 goto :x64
IF /I %PROCESSOR_ARCHITEW6432% == amd64 goto :x64
goto :x86
:: OS is 64bit
set vsBaseKey=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\
goto :findTF
:: OS is 32bit
set vsBaseKey=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\
goto :findTF
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%" %*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.