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
Related Q & A:
- How to return a value from .ashx file to javascript in a variable?Best solution by forums.asp.net
- How to skip columns empty in CSV file when importing into MySQL table using LOAD DATA INFILE?Best solution by Stack Overflow
- How to run an interactive batch file on windows from a service?Best solution by Stack Overflow
- How do I email someone a message?Best solution by Yahoo! Answers
- How to make a batch file copy itself?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.