How to skip the input in batch file?

How to skip and return a message if subscript prompts for user input in batch file

  • I'm testing new account creations by calling a script with the newly created account id/password. If everything is set up correctly the script reports back some text and continues on without pause. However if there's an issue the script will go to interactive mode asking for a userid/password. I'd like some kind of error catch (or in this case interactive input catch) and report back that there's an issue with the account. Is there a way of doing this?

  • Answer:

    If your script returns different exit codes depending on the success/failure, you can react on the errorlevel, using if, goto and labels. See http://stackoverflow.com/a/6817833/2606322 for the syntax.

johnny_5 at Stack Overflow Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.