Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to work on a batch script for windows (.bat) that executes some commands, and need to send the '|' character as a parameter. Here's an example:

echo hello|world

this will never return the hello|world string.. I tried to escape it using hello\|world, but still no success. How to fix this please ?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Try this:

echo hello^|world

In batch you can use carets or double quotes to escape special characters.

share|improve this answer
    
thank you for the help ! –  Reacen May 7 '13 at 8:25
add comment

Never mind, I found the solution.

echo Hello^|World

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.