Bob
For me, this
REM #ZTTag #ZTTemp\~ZTTag.bat -f"#ZTHOME\#ZTTOOLS\PDFTOOLS\test.bat" "%1" test.xyz
Generates a ~ZTTag.bat file with one line per tagged file, with the tagged files replacing the "%1".
So far so good.
But "#ZTHOME\#ZTTOOLS\test.bat" expands to this, which is an invalid path, so the command should fail.
"C:\Program Files\ZTree Windows\C:\Users\myusername\AppData\Roaming\ZTreeWin\PDFTOOLS\test.bat"
Maybe your #ZTTOOLS has a value that generates a valid path.
In your test.bat do a ECHO ON at the beginning and add a PAUSE at the end, then it might show what is going wrong.
Ben