Firefox not opening when IF statement is true batch -


i have little piece of code here, opens mysql , apache , asks user if wants open phpmyadmin well, doen not quite this, skips onto next lines.

@echo off  net start mysql net start apache2.4  set /p openpma=would open pma? (y/n)  if %openpma%=="y" "c:\program files (x86)\mozilla firefox\firefox.exe" http://localhost/phpmyadmin/  echo press key stop servers pause >nul  net stop mysql net stop apache2.4 

how can sove this?

i want start servers, ask user if wants open pma - if so, else continue - , stop servers if user presses key.

thanks in advance!

in case, quotes taken literally. that's way batch works, unlike unix/linux shells.

so if %openpma%=="y" should if /i "%openpma%"=="y" if want avoid enter "y".

(note quotes still have special meaning , useful, example run commands containing spaces in paths, no special processing done when comes strings)


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -