Created
February 20, 2015 21:37
-
-
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)
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 | |
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