In a subroutine, %0 expands to the subroutine name, not the script name. Is there a ligitimate way to still access the script name, or should I pass it as an argument?
@echo off
call :subroutine %~f0 my parameters
exit /b
:subroutine
shift
echo Script name is %0
echo Parameters: %1 %2
exit /b
I want the call statement to be just
call :subroutine my parameters