Good day, I am cuurently writing a batch file for a simple program and I am using VBscript to recieve input from users. At this point in the program I have the question: "Would you like to backup it now?" in a MsgBox. If the user presses yes, it has to go to a tag in the batch called :AUTOBACKUP. For no, it has to goto :REJECTAB. Here is the code I currently have, but it does not work? How could I correct it?
:STARTUPDAS
ECHO Wscript.echo i=msgbox("The automatic backup function is active. Would you like to backup now?", VBYesNoCancel + VBQuestion, "BACKUP")>vbst.vbs&vbst.vbs
SET _stringb
ENDLOCAL & SET i=%_stringb%
cls
cls
echo.
echo.
echo The automatic backup function is active.
echo Would you like to perform a backup now? Y/N
echo.
if i==6 goto AUTOBACKUP
if i==7 goto REJECTAB
echo.
echo Invalid option. Please try again
echo.
pause
:STARTUPDAS
ECHO Wscript.echo i=msgbox("The automatic backup function is active. Would you like to backup now?", VBYesNoCancel + VBQuestion, "BACKUP")>vbst.vbs&vbst.vbs
SET _stringb
ENDLOCAL & SET i=%_stringb%
cls
cls
echo.
echo.
echo The automatic backup function is active.
echo Would you like to perform a backup now? Y/N
echo.
if i==6 goto AUTOBACKUP
if i==7 goto REJECTAB
echo.
echo Invalid option. Please try again
echo.
pause
Thanks in advance.
For a simple MsgBox, it is better to use
WScript.Quit
to return as an errorlevel the result of the MsgBox function