I got a useful tip from this post: https://stackoverflow.com/a/374363/151453 , but plagued by doskey's special characters.
(env: Windows 7 and Windows XP)
Using Visual C++ command line, we have env-vars INCLUDE
and LIB
. So with this doskey macro,
doskey whichinclude=for %i in ($1) do @echo.%~$INCLUDE:i
we can easily findout which .h is found first in which INCLUDE directory, really convenient.
However, this trick fails for LIB
. I just CANNOT simply code a macro like:
doskey whichlib=for %i in ($1) do @echo.%~$LIB:i
Call whichlib winsock32.lib
, it spouts The system cannot find the file specified.
I launch Procmon to know what happens, it reveals:
So I realize $L
has special meaning for doskey
, it is replaced with current drive letter when run.
Try double dollar( @echo.%~$$LIB:i
), still not working, Procmon report CMD accessing C:\echo
.
Counld someone kindly help me out?
My doskey book mark: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/doskey.mspx?mfr=true