@echo off setlocal EnableDelayedExpansion set version=%~1 for /f "tokens=1,* delims= " %%a in ("%*") do set remaining_args=%%b set root_path=%devenver_root%\NodeJS set bin_path=%root_path%\%version% if "%~1"=="help" goto :help if "%~1"=="" goto :help if "%~1"=="--help" goto :help if "%~1"=="/?" goto :help goto :run :help echo USAGE: node_env.bat ^ [^] echo. echo VERSIONS: ls %root_path% goto :eof :run echo [SCRIPT] Adding to path '%bin_path%' and executing '%remaining_args%' set PATH=%bin_path%;%PATH% %remaining_args%