Skip to content

Instantly share code, notes, and snippets.

@Goheeca
Created February 20, 2015 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Goheeca/b07b22b15ce2625e5855 to your computer and use it in GitHub Desktop.
Save Goheeca/b07b22b15ce2625e5855 to your computer and use it in GitHub Desktop.
Executor which is setting the path variable from the file for a command (for Windows)
@echo off
setlocal enabledelayedexpansion
set PATH=
if not "%~1" == "" (
for /f "Tokens=* Delims=" %%x in (%1) do (
if [!PATH!] == [] (
set PATH=!PATH!%%x
) else (
set PATH=!PATH!;%%x
)
)
)
echo "%PATH%"
shift
set CMD=
:concat
if "%~1" == "" goto out
if [!CMD!] == [] (
set CMD=!CMD!%1
) else (
set CMD=!CMD! %1
)
shift
goto concat
:out
%CMD%
endlocal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment