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

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

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -