Is there any simple way to get the full directory of an exe that the windows is mapping though the PATH environment variable?
Something like:
C:\>whereis myexe
Have a look at this answer. You could turn the script shown here into a batch file that would work as you have suggested in your question:
Find the path of notepad.exe and mspaint.exe
Also, the Where commmand in Windows 7 does this:
where myexe.exe
You can create this batch file and give the exe file as argument
@setlocal
@set P2=.;%PATH%
@for %%e in (%PATHEXT%) do @for %%i in (%~n1%%e) do @if NOT "%%~$P2:i"=="" echo %%~$P2:i
You are looking for the UNIX "which" command. Here's a windows version:
http://pankaj-k.net/weblog/2004/11/equivalent_of_which_in_windows.html