1.

Solve : Netsat Output with timestamp?

Answer»

I have a simple batch file netstat -n -p tcp >> C:\temp\Capture_%date:~-4,4%%date:~-10,2%%date:~-7,2%.txt
I need to have the time in the text file each time it is appended.
I SAW an earlier post that had an answer but I cannot get it to WORK.
What can I add to the above batch file to get the date to show each time the file is appended?

ThanksWhere do you want the date in the file?Ignore this postIgnore my previous post, I re-read your post and altered the code accordingly.

Here is my editing code:
Code: [Select]set captureDate=%date:~-4,4%%date:~-10,2%%date:~-7,2%

netstat -n -p tcp >> c:\temp\Capture_%captureDate%.txt
echo
echo Date Captured: %captureDate% >> c:\temp\Capture_%captureDate%.txt Quote from: sd621 on DECEMBER 13, 2015, 08:46:58 PM

I need to have the time in the text file each time it is appended.
Quote from: sd621 on December 13, 2015, 08:46:58 PM
What can I add to the above batch file to get the date to show each time the file is appended?

I THINK there's a fly in the ointment here. Thanks for the help, works fine.


Discussion

No Comment Found