Created
July 19, 2011 11:23
-
-
Save DNNX/1092023 to your computer and use it in GitHub Desktop.
Windows equivalent of Unix which command by Pankaj Kumar
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 -------------------------------------------------------- | |
rem File: which.cmd | |
rem Description: Windows equivalent of Unix which command | |
rem Author: Pankaj Kumar | |
rem Copyright 2004 Pankaj Kumar. All Rights Reserved. | |
rem License: This software is available under GPL | |
rem --------------------------------------------------------- | |
setlocal | |
if "%1" == "" goto noArg | |
set fullpath=%~$PATH:1 | |
if "%fullpath%" == "" goto notFound | |
echo Found in PATH: %fullpath% | |
goto end | |
:noArg | |
echo No Argument specified | |
goto end | |
:notFound | |
echo Argument "%1" not found in PATH | |
:end | |
endlocal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment