I am trying to use the Shell function to echo a string to another file to create a batch file on the fly. This works fine except for this particular string because the string itself contains ">" to output to another file. Here's what I'm trying to do:
shell '%comspec% /c echo type c:\report.txt>c:\%computername%.txt>'+c:\test.bat

The desired result would be for test.bat to contain a line with:
type c:\report.txt>c:\%computername%.txt
Unfortunately, the > in the middle of the string causes a problem and I end up with only:
type c:\report.txt

any suggestions?