Hello,
the DocTool has most likely already finished at that point. pdf24-DocTool.exe is a Windows program with a graphical interface, not a console program. When you start such a program at an interactive command prompt, cmd does not wait for it and prints the prompt right away; the output of the DocTool then appears below the prompt. Simply press Enter and the prompt shows up again.
In a batch script, cmd waits until the DocTool has finished before it runs the next line. You can also make the waiting explicit with start /wait, as recommended in the manual:
start "" /wait pdf24-DocTool.exe -compress -noProgress -dpi 120 -imageQuality 60 -outputFile filename.pdf inputfilename.pdf
Since version 11.31.0 there is also the flag -silent for unattended scripts: no dialogs are shown, errors are written to stderr and returned as exit code. Details: https://creator.pdf24.org/manual/11/#11119-exit-codes
The options of the compress command are described here: https://creator.pdf24.org/manual/11/#11118-compress-pdf-files
Compressing also works online: https://tools.pdf24.org/en/compress-pdf