Skip to content

Batch

Created: 2016-01-02 20:25:33 -0800 Modified: 2019-01-22 09:04:21 -0800

call gulp publishToAws
IF !errorlevel! NEQ 0 GOTO :error
goto :EOF
:error
echo "PROBLEM"

(note: in Bash, this would be like output=program.exe or output=$(program.exe))

for /f i

I think that if you’re doing this on the command line, you only need one percent sign.

Take user input and store it in a variable

Section titled Take user input and store it in a variable

1/2/2016

  • set /p variable_to_store=“Prompt? [y/n] ”
  • echo %variable_to_store%
  • If you want no prompt, just do
    • set /p variable=