I'm trying to capture the time before I execute a command. Up to now, I have this code (I am using Windows 7 Pro) :
time < nul | findstr /r [0-9][0-9]*.*$
The above prints:
The current time is: 13:02:23.89
My questions are:
1) How do I get rid of the "The current time is: " string?
2) How do I assign the remaining value 13:02:23.89 to a variable?
Unfortunately, I cannot put other utilities in this computer, such as resource kits, cygwin, powershell, and other third-party executables. The solution must involve just DOS batch commands.
Thanks.