Carol
Carol

Reputation: 563

CMD measure command execution time

I'm stuck trying to print a custom command execution time. If I try to do something like this:

echo %time% & START "TestAgente" /W systeminfo  & echo %time%

I got same begin and end time:

enter image description here

I have tried with some combinations playing with delayed-expansion, but I think it fails (I guess) because in running 3 commands in a line instead of batch file.

Does anyone done something like this (without PowerShell). It has to be a single command line that someone could copy, paste and execute.

Upvotes: 2

Views: 9738

Answers (1)

Carol
Carol

Reputation: 563

Like @Stephan said, the right way was in that post, and it worked!!

cmd /v:on /c "echo !time! & START "TestAgente" /W systeminfo & echo !time!"

Upvotes: 1

Related Questions