Batch file depends on user response to VBScript MsgBox

I know how to create MsgBox with .vbs and how to run them with a batch file.

How do I write a conditional expression in a batch file so that the flow of execution depends on which MsgBox button the user clicks?

+3


source to share


1 answer


Test.vbs:

msgbox("Question",vbyesno,"Title")

      



Test.bat:

for /f "tokens=*" %%a in ('cscript //nologo test.vbs') do (
set results=%%a
)

if "%results%"=="6" (echo do something) else (echo do another thing)
pause

      

+2


source







All Articles