-Alex- Posted August 14, 2007 Share Posted August 14, 2007 (edited) Basically, I am looking to somehow run a command (even if it means using a program not built into Windows) to return the information in the screenshot below to a Command Prompt window. I.e. I want to open CMD, type a command, and it return the amount of packets that have been sent and received. Any help is much appreciated. I have tried Google; all I can find is GUI programs, and I need it to be command-line so I can use 'echo shell_exec("command");' in PHP to return the total amount of traffic cross-protocols. I'd use a HTTP bandwidth monitor, but that only takes into account the traffic the HTTP server uses, not the traffic that is used when being ran as a terminal server, RDC, a network access drive, etc. Edit: After Googling for a bit, I have found that calculating how much data has passed through the network adapter is, by means of going by how many packets it says, is not an accurate way to do it. Can somebody verify or disprove this? If so, how can I measure it? Edited August 14, 2007 by -Alex- Link to comment https://www.neowin.net/forum/topic/581021-network-bandwidth-in-cmd/ Share on other sites More sharing options...
+BudMan MVC Posted August 14, 2007 MVC Share Posted August 14, 2007 netstat -e would give you what your looking for C:\>netstat -e Interface Statistics Received Sent Bytes 82694452 144932594 Unicast packets 207106 252805 Non-unicast packets 33522 115 Discards 0 0 Errors 0 0 Unknown protocols 204218 Link to comment https://www.neowin.net/forum/topic/581021-network-bandwidth-in-cmd/#findComment-588779349 Share on other sites More sharing options...
-Alex- Posted August 14, 2007 Author Share Posted August 14, 2007 Thanks a lot! :D I'm not too familiar with the Windows command line, only *Nix so thanks a lot :) Link to comment https://www.neowin.net/forum/topic/581021-network-bandwidth-in-cmd/#findComment-588779367 Share on other sites More sharing options...
-Alex- Posted August 15, 2007 Author Share Posted August 15, 2007 I've come across a big problem with this. I've written the script in PHP that tells me how much data I've transfered. Only problem with that, is that as soon as either sent or received data hits 4GB, it resets both counters back to zero, as described here. I need some way of either changing the 4GB to something huge (say 10TB) - which I don't think is possible - or, I need another command-line program that I can run that won't reset after 4GB. Any suggestions? Link to comment https://www.neowin.net/forum/topic/581021-network-bandwidth-in-cmd/#findComment-588781666 Share on other sites More sharing options...
-Alex- Posted August 17, 2007 Author Share Posted August 17, 2007 Bump? Link to comment https://www.neowin.net/forum/topic/581021-network-bandwidth-in-cmd/#findComment-588786164 Share on other sites More sharing options...
DDStriker Posted August 19, 2007 Share Posted August 19, 2007 a cheap alternative would be to store the last value read say 3.9GB then as the script goes to read the value again if the new value is smaller then the old value then increase some counter by 1 and display that so your formula would be $output = (counter * 4096) + newvalue; printf($output . " MB transferred"); btw i don't code in php often so this may not be correct Link to comment https://www.neowin.net/forum/topic/581021-network-bandwidth-in-cmd/#findComment-588789997 Share on other sites More sharing options...
-Alex- Posted August 19, 2007 Author Share Posted August 19, 2007 That would require a script to be permanently running though - surely there is another way? Link to comment https://www.neowin.net/forum/topic/581021-network-bandwidth-in-cmd/#findComment-588790657 Share on other sites More sharing options...
Guest Posted August 23, 2007 Share Posted August 23, 2007 Nope, I had an IRC script that worked the same way. When it hit 4Gb it reset. Windows limitation :/ Link to comment https://www.neowin.net/forum/topic/581021-network-bandwidth-in-cmd/#findComment-588799705 Share on other sites More sharing options...
HDW-mobile Posted August 23, 2007 Share Posted August 23, 2007 same here, 4gb and counters reset to zero never paid attention to it. Link to comment https://www.neowin.net/forum/topic/581021-network-bandwidth-in-cmd/#findComment-588799794 Share on other sites More sharing options...
Recommended Posts