Two sets of double quotes batch file error -


why following batch script fail? because there 2 sets of double quotes? how work??

set income-code="test (bob, bob2)"  if "%income-code%"=="null" (    set apcinvoice=%apcinvoice%,   ) else (     set apcinvoice=%apcinvoice%%income-code%,   ) 

two things.

first, variable income-code has quotes in it. try short demonstration:

@echo off set test1="this string spaces" set "test2=this string spaces" echo %test1% echo %test2% 

second, comparing literal string "null". there no null value in batch. please see post more details: what proper way test if variable empty in batch file... want compare empty string or use 1 of methods in question above if you're working more complex.

if "%income-code%"=="" ( ... ) 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -