... which should put the entire parameter in "shell" single quotes
Ah, "the shell", my pet problem.
You are assuming that putting something in single quotes will prevent any shell from interpreting it. Sorry, but that assumption is wrong. Both the old (command.com) and the standard shell (cmd.exe) on Windows don't handle single quotes that way.
Generating a header file to be included by the C/XS code seems to be the more portable approach.
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)