Skip to content

Instantly share code, notes, and snippets.

@nutrino
Created July 15, 2016 07:02
Show Gist options
  • Save nutrino/f21262cd08bdd536c75b94d7f26b232f to your computer and use it in GitHub Desktop.
Save nutrino/f21262cd08bdd536c75b94d7f26b232f to your computer and use it in GitHub Desktop.
@echo off
SET MyPath=%PATH%
echo %MyPath%
echo --
setlocal EnableDelayedExpansion
SET TempPath="%MyPath:;=";"%"
SET var=
FOR %%a IN (%TempPath%) DO (
IF exist "%%~sa" (
SET "var=!var!;%%~sa
) ELSE (
echo %%a does not exist
)
)
echo --
echo !var:~1!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment