If I type a command in the prompt, the command processor searches it in current path, and then (if not found) in the paths listed in PATH environment variable.
So is there a way to easily know in which exactly path my typed command was found? It could be useful it your command may appear in several system paths.
Batch file with a parameter of my command is accepted as a solution.
Then, since self-answer is not accepted with my reputation, this is the answer I've found:
I have found a hint to this here, in a post in MSDN blog where Path Manipulation in a Batch File is described. Actually, we create and call the batch file below:
@REM this file is called where.in.PATH.cmd
@ECHO %1
@ECHO %~$PATH:1
If you want to find which 'tf.exe' will be executed, you just type:
where.in.PATH.cmd tf.exe
The output is:
tf.exe
C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe
i.e. the only full path which is used to execute the typed tf.exe, unlikely the output of where standard command suggested in answers below.