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

    • Where's the official link to sign up?
    • It's not a hardware or software issue, it's a hardware limitation. Good grief... Dell playing the semantics game.
    • Perplexity starts testing its Comet AI browser on Windows by Usama Jawad AI is all the rage these days with Microsoft heavily pushing Copilot, Google investing its efforts in Gemini and Veo, Apple still figuring out Apple Intelligence, and OpenAI continuing to dominate the headlines. Now, another player in this space, Perplexity, has decided that it wants a bigger chunk of the market too. We already know that Perplexity is interested in the browser market. In May, it rolled out a version of its AI browser, Comet, exclusively to Mac customers running Apple Silicon. As expected, this piece of software features AI capabilities front and center, including the ability to engage in conversations with the AI model in natural language, surface emails that you haven't responded to, and a "Try on" feature that enables users to upload a picture of themselves and then see AI-generated images of themselves with different pieces of clothing, just to get an idea of how aesthetic they could look if they wear certain garments. Now, Perplexity CEO Aravind Srinivas has posted on X (formerly Twitter) that testing for the Windows version of Comet has now begun: Now that the testing for Comet on Windows has begun with a handful of testers, it will be interesting to see when the browser will roll out generally to customers and what feature set will eventually become available for the masses. That said, it is important to note that AI browser is not a novel concept; Opera Neon was recently announced as the first "AI agentic" browser. On a side note, Perplexity has been in hot waters recently. It received backlash from people after it revealed plans to find out everything its customers do online so that it can present them hyper-personalized ads. UK news outlet BBC also threatened the firm with legal action over its content scraping practices. Via: Engagdet
    • probably because these will be a minority compared to our general tech coverage, plus these stories, their premises do seem quite interesting.
  • Recent Achievements

    • First Post
      Brett76 earned a badge
      First Post
    • One Year In
      78andyp earned a badge
      One Year In
    • One Month Later
      Cottonbud earned a badge
      One Month Later
    • One Month Later
      langat earned a badge
      One Month Later
    • One Month Later
      Nullun earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      598
    2. 2
      ATLien_0
      219
    3. 3
      Michael Scrip
      197
    4. 4
      +FloatingFatMan
      144
    5. 5
      Xenon
      135
  • Tell a friend

    Love Neowin? Tell a friend!