Created
November 2, 2017 22:02
-
-
Save AyrA/63dfb4683587230d9beb85eebfdb203e to your computer and use it in GitHub Desktop.
where command on Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
REM Store this anywhere in your PATH. | |
SETLOCAL | |
SET FULL=%~$PATH:1 | |
IF "%FULL%"=="" GOTO NF | |
GOTO PRINT | |
ECHO %FULL% | |
GOTO END | |
:NF | |
IF "%2"=="" GOTO TRYEXT | |
GOTO END | |
SET FULL=(not found) | |
GOTO PRINT | |
:TRYEXT | |
FOR %%I IN (%PATHEXT%) DO CALL "%~0" "%~1%%I" QQ | |
GOTO END | |
:END | |
ENDLOCAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment