0

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?

1 Answers1

0

If your script returns different exit codes depending on the success/failure, you can react on the errorlevel, using if, goto and labels. See this answer for the syntax.

Community
  • 1
  • 1
azt
  • 2,100
  • 16
  • 25
  • It does return errorlevel but only after asking for a correct userid/pw three times. Is there anyway to get around that without a user interaction? – johnny_5 May 08 '15 at 00:00
  • I see. Maybe there are some command-line parameters of your script that would make life easier (e.g. exit after every try)? On the other side, if the script outputs text, you could watch the standard out or standard err streams, and parse whether or not the password was correct. However, I wouldn't do that in a batch-file but write a small helper-program that does the hard work. – azt May 08 '15 at 00:31