This which.bat command works like Linux/bash 'which'
Save the Source as file which.bat and place it somewhere in the executable path.
Example usage: "which notepad.exe" results in "C:\WINDOWS\system32\notepad.exe". Note the .exe - 'which notepad' (without the .exe) results in "notepad not found in path"
See http://www.rdpslides.com/publiclinks/FAQ00138.htm for a description of the %~blah:1 syntax. The link describes the use of percent and tilde with environment variables.
This has a more extensive implementation: http://ss64.com/nt/which.cmd.txt
CommentsSubscribe to comments
You need to login to post a comment.