How to escape the > sign on Windows command line?

For example, foo -option 10->30 file.ext (this is an actual syntax required) redirects the output to a file named 30. How do I make cmd understand that I would like to pass the actual > character? I've tried several forms of double quotes to no avail.


Solution 1:

The cmd escape character is ^ so:

foo -option 10-^>30 file.ext

should work for you

Solution 2:

You can also quote the argument:

foo -option "10->30" file.ext