The :printDate
procedure is called another time because you don't finish the execution when calling the :exit
procedure, you are calling the :printDate
inside the :exit
procedure but after the echo Done
you are returning to the call :exit
line so :printDate
block is processed one more time then really the goto:eof
line inside the :printDate
is the real end of the script.
That is the meanning of a Call
, Instead you need to use the GoTo
keyword, like this:
...
REM call :exit
Goto :Exit
...
...
:exit
call:printDate
echo Done...
REM goto:eof
Exit