Skip to content

Instantly share code, notes, and snippets.

@lucacesari
Created September 16, 2014 15:11
Show Gist options
  • Save lucacesari/b9256f46bea62fcb9ad3 to your computer and use it in GitHub Desktop.
Save lucacesari/b9256f46bea62fcb9ad3 to your computer and use it in GitHub Desktop.
Test if a command is in the Windows %Path%
@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