I have a variable in my batch file and it contains the pipe symbol (this one: |) so when I echo the variable I get an error about a unrecognized internal/external command.>
You must escape the | character before you print the var. The following prints a|b
@echo off set x=a^|b echo %x:|=^|%