Clever workaround, though writing a file and reading it back is a little more cumbersome than I'd like. I was able to use back tics instead of "'" -- can you give this a try to avoid writing out the file?

FOR /F "usebackq tokens=1-8 delims=.[] " %%A IN (`ver`) DO (  ...

More on usebackq at http://ss64.com/nt/for_cmd.html.