bootlesnet

check lan speed

8 posts in this topic

Hi all,

I've one project that need to be helped. i'm newbie too, so that i dont know what to be start.

My project is check mainboard LAN speed is 100 or 1000Mbps.

In cmd i know an command that show exactly the speed, but dont know to use at autoit

the command is: "ping 192.168.1.1 -n 1 -l 65500"

when computer reply in time >=10ms then speed is 100Mbps, else reply time is 1,2 or 3ms then speed is 1000Mbps

The question is how to use this command to check that in autoit then show to gui

Or someone know the otherway to check that, please help me

So many thank for all although you can help or not!

Sorry for my bad english ^_^

Share this post


Link to post
Share on other sites



you can run that command and get the info, look at STDOutRead in help file.

WMI will also have that information on network interface speed, but im lousy with that, search "wmi network interface info" on web.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

you can run that command and get the info, look at STDOutRead in help file.

WMI will also have that information on network interface speed, but im lousy with that, search "wmi network interface info" on web.

can you suggest me the code! it's very hard with an newbie like me, thank you

Edited by bootlesnet

Share this post


Link to post
Share on other sites

I already suggested code "StdoutRead"

Here is basic example, try to search how to get the info you want, from the string variable.

$PID = Run(@ComSpec & " /c ping localhost -n 1 -l 65500", @WorkingDir, @SW_HIDE, 2)

While ProcessExists($PID)
    ;nothing
WEnd

$StringInfoFromCommandPromptWindow = StdoutRead($PID)

MsgBox(0,0, $StringInfoFromCommandPromptWindow)

 


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

You could also use WMI:

$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20

$oWMI = ObjGet("winmgmts:\\" & @ComputerName & "\root\cimv2")
$oItems = $oWMI.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
    If IsObj($oItems) then
        For $oAdapter In $oItems
            ConsoleWrite($oAdapter.Name & " Speed: " & $oAdapter.Speed & @CRLF)
        Next
    Else
        Msgbox(0,"Error","No WMI Objects Found for class: Win32_NetworkAdapter")
    Endif

 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I already suggested code "StdoutRead"

Here is basic example, try to search how to get the info you want, from the string variable.

$PID = Run(@ComSpec & " /c ping localhost -n 1 -l 65500", @WorkingDir, @SW_HIDE, 2)

While ProcessExists($PID)
    ;nothing
WEnd

$StringInfoFromCommandPromptWindow = StdoutRead($PID)

MsgBox(0,0, $StringInfoFromCommandPromptWindow)

 

when i run this it's pending forever, why?

You could also use WMI:

$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20

$oWMI = ObjGet("winmgmts:\\" & @ComputerName & "\root\cimv2")
$oItems = $oWMI.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
    If IsObj($oItems) then
        For $oAdapter In $oItems
            ConsoleWrite($oAdapter.Name & " Speed: " & $oAdapter.Speed & @CRLF)
        Next
    Else
        Msgbox(0,"Error","No WMI Objects Found for class: Win32_NetworkAdapter")
    Endif

 

this code is work but so many result, how to write this result to text,

thank you two for help!!!

Share this post


Link to post
Share on other sites

Don't know, try changing localhost to the ip of the adapter you want to test.

i'm sure that i was change it, i dont understand why too @@

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now