Page 1 of 1

ESCAPE Character Problem

Posted: 25 Jun 2010 09:37
by skaa
Hi,

This code:

set sfv=ab,cd
set sfvi=%sfv%
if [%sfvi%]==[] echo pppppppppppppppppp

gives me this response:

C:\business\Batch\Env\envString>set sfv=ab,cd
C:\business\Batch\Env\envString>set sfvi=ab,cd
cd]==[] was unexpected at this time.
C:\business\Batch\Env\envString>if [ab,cd]==[] echo pppppppppppppppppp

. How to escape (,) character to avoid "cd]==[] was unexpected at this time." error message?

Thanks.

Re: ESCAPE Character Problem

Posted: 25 Jun 2010 12:38
by aGerman
The comma is a delimiter (similar to a space character). Use double quotes instead of square brackets.

Code: Select all

set sfv=ab,cd
set sfvi=%sfv%
if "%sfvi%"=="" echo pppppppppppppppppp


Regards
aGerman

Re: ESCAPE Character Problem

Posted: 25 Jun 2010 15:26
by skaa
Thank you!!! It works.