It turns out that on windows if you run a command with a windows command file you need to escape the % character as %%
In my case I could test freeze and thaw calls at the command line successfully as
..\bin\cache -s. -U%SYS ##Class(Backup.General).ExternalFreeze()
...but when my freeze script ran it would fail.
it turns out that a single '%' is striped when run in a windows command file, and it must be escaped as '%%' windows gets: