Created
September 16, 2014 15:11
-
-
Save lucacesari/b9256f46bea62fcb9ad3 to your computer and use it in GitHub Desktop.
Test if a command is in the Windows %Path%
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 Usage: test_path.bat cmd_to_test | |
for %%x in (%1) do ( | |
if not [%%~$PATH:x]==[] ( | |
echo "Command %1 found" | |
goto :eof | |
) | |
) | |
echo "Command %1 NOT found" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment