Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6569641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:39:27+00:00 2026-05-25T14:39:27+00:00

I’m displaying several info from a PC in a 16×2 LCD Screen. I use

  • 0

I’m displaying several info from a PC in a 16×2 LCD Screen. I use a tiny python program that retrieves and parse data (disk space, temperatures, etc) and send to LCD by serial.

I want to show the actual download/upload speed, but I can’t find any cmd script or something like that to use. Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:39:27+00:00Added an answer on May 25, 2026 at 2:39 pm

    You need to query WMI to get this information. The easiest way to do it from Python is to simply execute this VB Script (it worked for me):

    Option Explicit 
    On Error Resume Next
    dim strComputer
    dim wmiNS
    dim wmiQuery
    dim objWMIService
    Dim objLocator
    dim colItems
    dim objItem
    Dim strUsr, strPWD, strLocl, strAuth, iFLag 'connect server parameters
    Dim colNamedArguments 'WshNamed object
    
    subCheckCscript  'check to see if running in cscript
        Set colNamedArguments = WScript.Arguments.Named
        strComputer = colNamedArguments("c")
    subCheckArguments
    
    wmiNS = "\root\cimv2"
    wmiQuery = "Select BytesTotalPerSec from Win32_PerfFormattedData_Tcpip_NetworkInterface"
    strUsr = colNamedArguments("u") '""'Blank for current security. Domain\Username
    strPWD = colNamedArguments("p") '""'Blank for current security.
    strLocl = "" '"MS_409" 'US English. Can leave blank for current language
    strAuth = ""'if specify domain in strUsr this must be blank
    iFlag = "0" 'only two values allowed here: 0 (wait for connection) 128 (wait max two min)
    
    Set objLocator = CreateObject("WbemScripting.SWbemLocator")
    Set objWMIService = objLocator.ConnectServer(strComputer, _
         wmiNS, strUsr, strPWD, strLocl, strAuth, iFLag)
    Set colItems = objWMIService.ExecQuery(wmiQuery)
    
    For Each objItem in colItems
       Wscript.Echo funLine("Name: " & objItem.name)
       Wscript.Echo "CurrentBandwidth: " & funConvert("M",objItem.BytesTotalPerSec )
    
    Next
    
    
    ' *** subs are below ***
    Sub subCheckCscript
    If UCase(Right(Wscript.FullName, 11)) = "WSCRIPT.EXE" Then
        Wscript.Echo "This script must be run under CScript"
        WScript.Quit
    End If
    end Sub
    
    Sub subCheckArguments
    If colNamedArguments.Count < 4 Then
        If colNamedArguments.Exists("?") Then 
            WScript.Echo "Uses Win32_PerfFormattedData_Tcpip_NetworkInterface to determine bandwidth" _
        &   VbCrLf & "This script can take arguments. It will analyze bandwidth of network adapter"_
        &   VbCrLf & "This is useful when you want to see the actual bandwidth of a network adapter" _
        &   VbCrLf & "Perhaps to troubleshoot cases when the adapter autodetects the wrong speed" _
        & VbCrLf & "Alternate credentials can ONLY be supplied for remote connections" _
        & VbCrLf & "Try this: cscript " & WScript.ScriptName & " [/c:yourcomputername] [/u:domainName\UserName] [/p:password]" _
        & VbCrLf & "Example: cscript " & WScript.ScriptName & " /c:london /u:nwtraders\londonAdmin /p:P@ssw0rd" _
        & VbCrLf & vbTab & " Connects to a remote machine called london in the nwtraders domain with the londonAdmin user" _
        & VbCrLf & vbTab & " account and the password of P@ssw0rd. It returns the speed of each network adapter" _
        & VbCrLf & "Example: cscript " & WScript.ScriptName _
        & VbCrLf & vbTab & " Returns the speed of each network adapter on local machine"
        WScript.Quit
        End If
    WScript.Echo "checking arguments"
        If Not colNamedArguments.Exists("c") Then
            WScript.Echo "Executing on Local Machine only"
            strComputer = "localHost"
        End If 
        If Not colNamedArguments.Exists("u") Then
            WScript.Echo "Executing using current user name"
            strUsr = ""
        End If 
        If Not colNamedArguments.Exists("p") Then
            WScript.Echo "Executing using current user password"
            strPWD = ""
        End If 
    End If
    If colNamedArguments.Count = 0 Then
        Exit Sub
    End If
    End Sub
    
    Function funConvert(strC,intIN)
    Select Case strC
    Case "K"
    funConvert = formatNumber(intIN/1000) & " KiloBytes"
    Case "M"
    funConvert = formatNumber(intIN/1000000) & " MegaBytes"
    Case "G"
    funConvert = formatNumber(intIN/1000000000) & " GigaBytes"
    End Select
    End Function
    
    Function funLine(lineOfText)
    Dim numEQs, separator, i
    numEQs = Len(lineOfText)
    For i = 1 To numEQs
        separator= separator & "="
    Next
     FunLine = VbCrLf & lineOfText & vbcrlf & separator
    End Function
    

    adapted from http://www.itworld.com/nlswindows070320?page=0,1

    Copy and paste the VB code into a file called bandwidth.vbs and run like this from cmd:

    cscript bandwidth.vbs
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I am currently running into a problem where an element is coming back from
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.