Passing workflow variables on a batch script

Having fought this battle myself, with a complex workflow variable set by the command-line, I will offer this bit of advice for the next person. 

Write a very small workflow that simply echos the variable into a file.  I chose to write it as a comment into a csv file.  That's the only way I was able to debug all the quoting and escaping.

Cheers,

Bill