Is ther a way to manage strings with & and | and " ?
Posted: 06 Jul 2015 10:01
Hi,
I would like to know if it's possible to manage strings with at the same time & and | and " ? here is a snippet of my failed attemps :
which gives :
Thanks a lot by advance
I would like to know if it's possible to manage strings with at the same time & and | and " ? here is a snippet of my failed attemps :
Code: Select all
@echo off
setlocal enabledelayedexpansion
ver
echo ==============
set ONE=u "A&B" v
set TWO=ww %ONE% || xx
echo ONE=%ONE%
echo TWO=%TWO%
echo ==============
set ONE=u "A&B" v
set TWO=ww %ONE% ^|^| xx
echo ONE=%ONE%
echo TWO=%TWO%
echo ==============
set "ONE=u "A&B" v"
set "TWO=ww %ONE% || xx"
echo ONE=%ONE%
echo TWO=%TWO%
echo ==============
set "ONE=u "A^&B" v"
set "TWO=ww %ONE% || xx"
echo ONE=%ONE%
echo TWO=%TWO%
which gives :
Code: Select all
Microsoft Windows [Version 6.1.7601]
==============
ONE=u "A&B" v
TWO=ww u "A&B" v
==============
ONE=u "A&B" v
TWO=ww u "A&B" v
==============
'B" v"' is not recognized as an internal or external command,
operable program or batch file.
ONE=u
TWO=ww u
==============
'B" v || xx"' is not recognized as an internal or external command,
operable program or batch file.
ONE=u "A&B" v
TWO=ww u
Thanks a lot by advance