Reputation: 1238
I want to run a script which takes a parameter.
this is a sample from the script:
SET application=%1
if (%application%=="prod") (echo "production") else (echo "staging")
i run the script like that script.bat prod
but staging
is printed to the screen and not production
What am i doing wrong?
Upvotes: 0
Views: 57
Reputation: 80761
You should enclose your variable with quotes : " (and remove superfluous () around the condition)
if "%application%"=="prod" (echo "production") else (echo "staging")
Upvotes: 1