OS: Windows 7, Windows 8, Windows 8.1
Using the Windows command line, I can see the current user's logon time using the quser command. This results in more output than I desire, so I'm hoping to use for skip and tokens to get only the logon time and date.
As an example
c:\quser.exe
--------------------------
USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME
GenericUser console 1 Active 1:22 03/11/2015 1:45 PM
Using for, I can whittle this down, but it's taking the space between the date and time as a delimiter and therefore only giving me the date:
c:\for /f "skip=1 tokens=6" %a in ('quser') do echo %a
--------------------------
03/11/2015
Note that the output is missing the "1:45 PM". Of note, I can't specify multiple tokens because there are only 6 headers, so I can't get a 7th token from the second line. How can I modify this to collect the time as well as the date?
*Don't worry about calculating the datediff, as I'll be handling that in VBScript once I can properly collect it.
Thanks in advance, Beems