Skip to content

Instantly share code, notes, and snippets.

@DNNX DNNX/which.cmd
Created Jul 19, 2011

Embed
What would you like to do?
Windows equivalent of Unix which command by Pankaj Kumar
@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
You can’t perform that action at this time.