So I've googled and searched stackflow; I think the output for the library I'm using and the way it's structured makes none of the answers work.
I downloaded a windows library called totp2 for command prompt. I am executing the command in my batch file and that works fine, but it wants to return the line I passed.
I'm looking to run the command, and only assign the very last line to a variable; stripping the word OTP: from the last line.
C:\Users\Dan\Desktop\devBash> t2otp.exe QQRZO4QIGPJFXS2QXDIL4JUO2KKQCPTOF2D5AX5M3R2VH5NM2ZUSXIXGP4WPMVTR sha256 6 30
T2OTP v2 - Command line TOTP Generator (c) TOKEN2
Algorithm: sha256
Seed: QQRZO4QIGPJFXS2QXDIL4JUO2KKQCPTOF2D5AX5M3R2VH5NM2ZUSXIXGP4WPMVTR
Interval: 30 seconds
OTP length: 6 digits
OTP: 666323
The above is exactly how it returns the command prompt results, with the code being on line 7 of the command output.
Current Code (hardcoded command just for testing):
For /F "EOL=/" %%A In ('t2otp.exe QQRZO4QIGPJFXS2QXDIL4JUO2KKQCPTOF2D5AX5M3R2VH5NM2ZUSXIXGP4WPMVTR sha256 6 30') Do Set "totp=%%A"
However that returns just OTP:
Current Result:
OTP: 666323
Needed Result:
666323
Any help is really really appreciated.
And yes; it's a demo secret.
for /f "tokens=2delims=: " %%A...should derive that data