On Windows 7 I'm using
runas /netonly /user:... to run something under a different account. If I mistype the password the program starts under my current user.
runas doesn't even appear to set the
ERRORLEVEL when this happens. Is there any way to detect when the user mistyped and failed to log on to the new account? The following doesn't work:
runas /netonly /user:my_other_username c:\programs\etc\something.exe if ERRORLEVEL 1 pause
Why does the program start, rather than failing and reporting the bad password? I can't think of any good reason why this should be the default behaviour.