home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 40,766 of 42,547   
   foxidrive to Todd Vargo   
   Re: if statement   
   25 Sep 13 09:30:24   
   
   From: foxidrive@no.server.invalid   
      
   On 25/09/2013 08:03, Todd Vargo wrote:   
   > On 9/24/2013 2:01 PM, ehabaziz2001@gmail.com wrote:   
   >> I can not find that code is working . It yields bad syntax ??   
   >>   
   >>   
   >> @%pathscripts%\set_cert_file.bat ::contains set_cert_file=value   
   >>   
   >> @if %set_cert_file%!=""   
   >> (   
   >> echo " I am in cert has value"   
   >> )   
   >>   
   >   
   > You need to double the = for correct syntax or use EQU. However, even if   
   > %set_cert_file% was set to contain "", it will never be true because the   
   > left side has the ! but the right side does not.   
   >   
   > Type IF/? at prompt more information.   
   >   
      
      
   The parenthesis has to be on the same line, also.   
      
   if "%set_cert_file%"=="" (   
    echo " I am in cert has value"   
    )   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca