I know that I can call another batch file using call path_to_other_batch_file.bat.
However, I don't know how can I call functions inside that file.
I have this batch file called Message.bat:
@echo off
EXIT /B %ERRORLEVEL%
:Error
echo [31m %* [0m
EXIT /B 0
:Warning
echo [33m %* [0m
EXIT /B 0
:Info
echo [34m %* [0m
EXIT /B 0
:Success
echo [32m %* [0m
EXIT /B 0
:Reset
echo [37m %* [0m
EXIT /B 0
And I want to use these functions in my other batch files so that I can simply write call:Error something went wrong without worrying about colors all the time.
I use it this way in Other.bat, but it does not work:
call C:\Infra\Message.bat
call:Error something went wrong
I receive this error:
The system cannot find the batch label specified - Error
So, how can I call those methods defined in my Message.bat file?