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

    • Download old Windows Startup Sounds @ https://www.winhistory.de/more/winstart/winstart_en.htm
    • Surface Copilot+ PCs coming to classrooms from July 22, turbocharged with on-device AI by Paul Hill Microsoft has announced that it’s launching the new Surface Pro 12-inch and Surface Laptop 13-inch models specifically for education customers from July 22. The Redmond giant said that these devices are being launched as a direct response to feedback from educators who want practicality and ease of use in their diverse classrooms. These are both Copilot+ PCs so teachers and students will be able to leverage the latest AI features thanks to the dedicated Neural Processing Units (NPUs) that allow for on-device AI. The on-device AI, aside from delivering well-known features like Recall, will enable new education features such as a new app Microsoft is working on called Microsoft Learning Zone. Microsoft Learning Zone will allow teachers to create personalized lessons by adapting content from trusted sources like OpenStax, generating interactive games with Kahoot, and tracking students progress. Microsoft expects this to help teachers save time and deliver a more flexible and engaging classroom. Another AI feature that will be available is Click to Do. This lets students highlight text or images and get contextual help. It can be used to summarize a paragraph or explain a graph. To activate it, students can press the Windows key and click. This feature runs entirely on device so inputs to the AI are secure and you don’t need to ever worry about third-parties seeing. Finally, these devices will also have accessibility features such as Voice Access which lets you navigate with speech and Live Captions which provide real-time subtitles and translations for spoken content. These make the devices more inclusive for students with disabilities. Regarding security, these laptops come with the Microsoft Pluton security chip directly integrated into the processor for protecting sensitive data. It can protect data such as passwords and sign-ins, even if your device is stolen. Thanks to automatic Windows Updates, schools never need to worry about falling behind on updates either. With the impending demise of Windows 10 in mid-October, these Surface devices arrive just in time for schools looking for somewhere to upgrade to. Aside from AI features and security, Microsoft is also pushing other key features including easy repair with replacement components at the Microsoft Store and iFixit, their lightweight design and all-day battery life making them ideal for carrying and surviving the school day, and their compatibility with popular education apps such as TestNav, Google Classroom, Minecraft Education, and Adobe Express.
  • Recent Achievements

    • Rising Star
      Phillip0web went up a rank
      Rising Star
    • One Month Later
      Epaminombas earned a badge
      One Month Later
    • One Year In
      Bert Fershner earned a badge
      One Year In
    • Reacting Well
      ChrisOdinUK earned a badge
      Reacting Well
    • One Year In
      Steviant earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      545
    2. 2
      ATLien_0
      205
    3. 3
      +FloatingFatMan
      170
    4. 4
      Michael Scrip
      151
    5. 5
      Som
      131
  • Tell a friend

    Love Neowin? Tell a friend!