Recommended Posts

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.

post-176093-1187123254_thumb.png

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 by -Alex-
Link to comment
https://www.neowin.net/forum/topic/581021-network-bandwidth-in-cmd/
Share on other sites

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

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?

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

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Google Chrome is ending support for two ancient versions of Android by Usama Jawad Google Chrome is the most used browser right now, with the competition trailing far behind. What browser you use typically ends up being a matter of preference and familiarity, but all vendors are trying to one-up each other as they vy for more market share. Recently, Google claimed that Chrome is now faster than ever while Microsoft boasted that Edge is better at ad-blocking than Google's offering. Regardless of all these factors, Chrome commands a significant market share, even on legacy systems. Now, Google has announced that it is ending support for Chrome on two legacy versions of Android. In a brief blog post, Google has announced that it is dropping support for Chrome on Android 8 Oreo and Android 9 Pie with the upcoming version 139 of the browser expected to release on August 5. Right now, the current stable version of Chrome is 137, which means that Chrome 138 will be the last version of the browser to support these legacy operating systems. In practice, this means that Chrome will require Android 10.0 or above on mobile platforms in order to receive further updates. While the browser will continue working on older versions of Android, they will not receive updates, which means that they'll be left insecure and vulnerable to cybersecurity threats. As expected, Google has recommended that users on older systems should migrate to at least Android 10 in order to continue receiving updates on Chrome. While the company hasn't explicitly stated a reason behind its decision, it likely has to do with the dwindling user base of these old versions of Android and Google's ambitions to get more people to upgrade to newer versions of its mobile operating system. It's important to note that Android 8 was released in August 2017 and received its final security patch in October 2021. Meanwhile, Android 9 was rolled out to the public in August 2019 and netted its final update in January 2022. So in retrospect, Google has already been offering Chrome support for these legacy versions long after they hit end-of-support themselves.
    • I use two of these in RAID0 for video games and other things, together they are capable of 2.8 million IOPS and 15 GB/s on Gen4. At this price, 4 TB of Gen4 is faster and less expensive than a single 2 TB Gen5 NVMe, not to mention easier to cool off. Highly recommend.
    • that is a normal sign in, they just put in a dumb location to try to hide it... and yes I think the whole MS account by default is BS too, the first question should be do you want an online profile or a local one
    • From our past comments, it looks like some ppl are defo enjoying these stories.
    • You are missing the point, we should not have to do that. Should have a do you want an MS account option on the normal sign in.
  • Recent Achievements

    • One Month Later
      adnan.hebibovic earned a badge
      One Month Later
    • Week One Done
      adnan.hebibovic earned a badge
      Week One Done
    • Dedicated
      tesla maxwell earned a badge
      Dedicated
    • Dedicated
      Camlann earned a badge
      Dedicated
    • Week One Done
      fredss earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      630
    2. 2
      Michael Scrip
      224
    3. 3
      ATLien_0
      219
    4. 4
      +FloatingFatMan
      143
    5. 5
      Xenon
      134
  • Tell a friend

    Love Neowin? Tell a friend!