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

    • Yeah, I can see that. I would hope that an xbox branded handheld could bridge the legal gap. Maybe to help get around the legal definitions of the differences between Windows and xbox, they could just make it dual-boot. That would be kind of shame because I'm sure an xbox app could do all the same things, but if you have to totally shutdown windows and start it up in "xbox mode" then perhaps the game studios would be more okay with that...then down the road maybe a hot new update removes the requirement to reboot to change modes :-)
    • You will soon be able to book hotels directly through the PayPal app by David Uzondu PayPal is getting into the hotel booking business, thanks to a new partnership with the booking technology company Selfbook, announced today. The plan will stick a hotel booking section right inside the PayPal app, letting millions of users find and pay for rooms from Selfbook's partner hotels. If you have never heard of the company, Selfbook is a booking and payment platform that is usually integrated into a hotel's website to make the often-annoying reservation process a lot easier. Its tech helps hotels get more people booking right on their own site by offering payment options people actually use, like digital wallets. Now, instead of just living on individual hotel sites, Selfbook's network will be featured in PayPal's Offers tab. For hotels, this gives them a direct line to a huge audience of logged-in users. PayPal also says that this partnership will help bring travel booking "into the age of agentic AI," with the help of Perplexity, the conversational AI-powered search engine. The idea is that you will be able to just chat with an AI about a trip, and when it is time to book, you can pay for your hotel right there in the conversation. Selfbook provides the plumbing to make the booking happen, while PayPal and Venmo will show up as the payment methods. According to the PayPal announcement: To handle the money side of things, Selfbook is moving all of its direct card processing over to PayPal's Enterprise Payments platform. For travelers, this just means more choice at checkout. People booking at a hotel that uses Selfbook will see options to pay with PayPal or Venmo, along with "Buy Now, Pay Later" plans for splitting up the cost of a stay.
    • So a rando with an unknown setup has an issue that I am not having, what is your point? I could easily reply with a reddit commenter complaining about Windows 10, but it would be just as pointless as your link. My experience is my experience. It seems like you are trying to prove something different than what my own eyes see. Others may have issues with 11 and choose not to use it for their own reasons, but you'll never be successful trying to tell me I should be concerned with issues that don't exist on my systems.
  • Recent Achievements

    • Enthusiast
      the420kid went up a rank
      Enthusiast
    • Conversation Starter
      NeoToad777 earned a badge
      Conversation Starter
    • Week One Done
      VicByrd earned a badge
      Week One Done
    • Reacting Well
      NeoToad777 earned a badge
      Reacting Well
    • Reacting Well
      eric79XXL earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      470
    2. 2
      +FloatingFatMan
      277
    3. 3
      ATLien_0
      245
    4. 4
      snowy owl
      204
    5. 5
      Edouard
      190
  • Tell a friend

    Love Neowin? Tell a friend!