-1

So I have

:function (
    file.bat
    echo test
    goto:function
)

When I call the function, file.bat get executed but nothing more happen, even when file.bat arrive to the end.

I tried to put the echo before the execution of file.bat and the text is printed, I figured out that the script stop running after the execution of a file. Is there a way to avoid that ?

danfixt
  • 3
  • 1
  • 1
    The `(` is not relevant - it's ignored as a label is terminated at the first separator (space). You are then executing `file,bat`, which transfers execution to that batch, never to return. You need to `call file.bat` in order that execution resumes in *this* batch once the `call`ed batch ends. – Magoo Dec 12 '22 at 00:03

1 Answers1

1

replace file.bat with call file.bat. See here.