windows - if statement not working batch -


so have batch file has this:

if "%1" == "dev" (    rem ... ) else (    rem else ... ) 

and have echo command above if-else block

echo "%1" >> test.txt 

the content of test.txt after running "dev" (with double quotes). however, hit else block instead of if block. checked putting echo command inside else ()

else have in same line of ) , (

if /? show usage:

if exist filename (     del filename  ) else (     echo filename not found ) 

or in 1 line:

if exist filename ( del filename ) else ( echo filename not found ) 

or in 2 lines

if exist filename ( del filename  ) else ( echo filename not found ) 

2 lines variation

if exist filename ( del filename ) else (  echo filename not found ) 

etc...


Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

android - How to create dynamically Fragment pager adapter -

html - Outlook 2010 Anchor (url/address/link) -