How to build a check when scm list credentials doesn't return any message and ErrorLevel=0 when not logged in?
![]()
Hi all,
I am using RTC CLI 4.0.2 on Win7 64-bit.
You can store (l)scm login credentials with argument '-c' in the command: scm login -r %SrvURI% -u %UserID% -P %UserPwd% -n %SrvURInickname% -c.
When I want a script to check the (l)scm login credentials, you can use command: scm list credentials.
If login credentials are available the return says:
%SrvURI%, %UserID%, %SrvURInickname%, <No certificate>, <No smartcard>, <Password stored>
Enough return values to check and %ERRORLEVEL% is 0, which is as expected.
However, when there are -no- credentials stored, i.e. there's no rtc login, the command 'scm list credentials' doesn't return -any- value and %ERRORLEVEL% is 0.
When I do a: FOR /F %%i IN ('scm list credentials') DO echo Value 1=%%i, I get nothing returned, not even "Value i="
How can I create a check in my batch file to see if a login is available?
Any pointers?
|