The command “call” calls:
The START command create a new cmd.exe process with then a new context (new environment variable) (with the /b option it will not open a new window)
CALL filePathName arguments
where:
The CALL command now accepts labels as the target of the CALL.
CALL :label arguments
:label
REM exit the subroutine
goto :EOF
where:
ie How to create a DOS function ? (known also as a subroutine)
@echo off
call :subroutine %*
exit /b %ERRORLEVEL%
:subroutine
echo Hello %*
goto :eof
:subroutine2
echo We will never see this
On the console:
echo.bat Nico
Hello Nico