Windows – How to escape the > sign on Windows command line

command-line-interfacewindowswindows-command-prompt

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.

Best Answer

The cmd escape character is ^ so:

foo -option 10-^>30 file.ext

should work for you