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

    • Without regulation, greed has no limits...If you go and post an ad on a billboard without permission, you'd be arrested for trespassing or vandalising private property, yet these companies keep doing it on our paid products scott-free. Be it "Smart" TVs, Phones in this case, displays, Laptops, Desktops, etc. I'm eagerly waiting for the day the EU makes a regulation that requires these tech giants pay end users 50%+ for ANY form of further monetization on products users have paid for when that wasn't explicitly displayed on the product purchase page in normal 12pt sized font. Then and only then will all these nonsense "updates" introducing ads on our devices be put to an end.
    • The 75-inch Hisense U7 Series mini-LED TV drops to its all-time low price by Fiza Ali Amazon US is currently offering the 75-inch Hisense U7 Series Google Smart TV at its lowest price to date. So, if you are considering an upgrade to your home entertainment system, it may be worth a look. The U7 features Mini-LED Pro technology, providing a peak brightness of up to 1,500 nits alongside Full Array Local Dimming Pro for improved contrast. Its QLED Quantum Dot panel covers over a billion colours, delivering a wide colour gamut. Furthermore, the TV's Hi-View Engine PRO chipset uses deep-learning algorithms and technologies such as Dynamic Tone Mapping Pro, Face Detection, AI HDR Enhancement and AI Detail Enhancement to refine image quality. Its sound is handled by a 2.1 multi-channel system with three speakers, offering up to 40W of output and a built-in subwoofer. Moreover, the smart audio decoding supports a 2.1 surround-sound experience without the need for additional equipment. For gaming, the 144Hz Game Mode Pro offers a Variable Refresh Rate (VRR) from 48Hz to 144Hz, AMD FreeSync Premium Pro, Auto Low Latency Mode (ALLM), and Low Latency MEMC, helping to reduce screen tearing and input lag. When it comes to the connectivity options, this Google Smart TV includes two USB-A ports and two HDMI 2.1 ports which support 4K resolution at 60Hz. Additionally, it includes one HDMI 2.1 port with eARC technology and another HDMI 2.1 port, both supporting 4K resolution at 144Hz. 75-inch Hisense U7 Series Google Smart TV: $799.99 (Amazon US) - 11% off This Amazon deal is US-specific and not available in other regions unless specified. If you don't like it or want to look at more options, check out the Amazon US deals page here. Get Prime (SNAP), Prime Video, Audible Plus or Kindle / Music Unlimited. Free for 30 days. As an Amazon Associate, we earn from qualifying purchases.
    • Google Chrome 138 (offline installer) by Razvan Serea The web browser is arguably the most important piece of software on your computer. You spend much of your time online inside a browser: when you search, chat, email, shop, bank, read the news, and watch videos online, you often do all this using a browser. Google Chrome is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier. Use one box for everything--type in the address bar and get suggestions for both search and Web pages. Thumbnails of your top sites let you access your favorite pages instantly with lightning speed from any new tab. Desktop shortcuts allow you to launch your favorite Web apps straight from your desktop. Chrome has many useful features built in, including automatic full-page translation and access to thousands of apps, extensions, and themes from the Chrome Web Store. Google Chrome is one of the best solutions for Internet browsing giving you high level of security, speed and great features. Important to know! The offline installer links do not include the automatic update feature. Google Chrome 138.0.7204.50 release notes: Chrome 138.0.7204.49 (Linux) 138.0.7204.49/50 Windows and Mac contains a number of fixes and improvements -- a list of changes is available in the log. This update includes 11 security fixes. Notably, several of these fixes were contributed by external researchers. For additional details, refer to the Chrome Security Page. [$4000][407328533] Medium CVE-2025-6555: Use after free in Animation. Reported by Lyra Rebane (rebane2001) on 2025-03-30 [$1000][40062462] Low CVE-2025-6556: Insufficient policy enforcement in Loader. Reported by Shaheen Fazim on 2023-01-02 [$1000][406631048] Low CVE-2025-6557: Insufficient data validation in DevTools. Reported by Ameen Basha M K on 2025-03-27 [427296461] Various fixes from internal audits, fuzzing and other initiatives Download web installer: Google Chrome Web 32-bit | Google Chrome 64-bit | Freeware Download: Google Chrome Offline Installer 64-bit | 128.0 MB Download: Google Chrome Offline Installer 32-bit | 115.0 MB Download page: Google Chrome Portable Download: Google Chrome MSI Installers for Windows (automatic update) View: Chrome Website | Release Notes Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Ironically, I have both an old 710 and 1030 in my closest I have saved for years for just in case I want to turn an old AMD CPU without IGP into a server. Sadly, I think products like that will never come back. IGPs have gotten good enough that a 10 series simply doesn't need to exist, even something like a 30 series would likely get outdone by a modern AMD APU or Intel Ultra with embedded Arc graphics. Sure, some people with older systems might be interested, but that is just a tiny mark share that you can't really make a product out of it. Even my above use case of repurposing an old AMD CPU is a fading one, now that modern AMD X-series CPUs even include an IGP.
  • Recent Achievements

    • Week One Done
      DrRonSr earned a badge
      Week One Done
    • Week One Done
      Sharon dixon earned a badge
      Week One Done
    • Dedicated
      Parallax Abstraction earned a badge
      Dedicated
    • First Post
      956400 earned a badge
      First Post
    • Week One Done
      davidfegan earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      618
    2. 2
      ATLien_0
      228
    3. 3
      +FloatingFatMan
      169
    4. 4
      Michael Scrip
      166
    5. 5
      Som
      146
  • Tell a friend

    Love Neowin? Tell a friend!