bootlesnet Posted October 30, 2015 Share Posted October 30, 2015 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 autoitthe 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 1000MbpsThe question is how to use this command to check that in autoit then show to guiOr someone know the otherway to check that, please help meSo many thank for all although you can help or not!Sorry for my bad english ^_^ Link to comment Share on other sites More sharing options...
JohnOne Posted October 30, 2015 Share Posted October 30, 2015 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. Link to comment Share on other sites More sharing options...
bootlesnet Posted October 30, 2015 Author Share Posted October 30, 2015 (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 October 30, 2015 by bootlesnet Link to comment Share on other sites More sharing options...
JohnOne Posted October 30, 2015 Share Posted October 30, 2015 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. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 30, 2015 Moderators Share Posted October 30, 2015 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 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
bootlesnet Posted October 30, 2015 Author Share Posted October 30, 2015 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!!! Link to comment Share on other sites More sharing options...
JohnOne Posted October 30, 2015 Share Posted October 30, 2015 Don't know, try changing localhost to the ip of the adapter you want to test. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
bootlesnet Posted October 30, 2015 Author Share Posted October 30, 2015 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 @@ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now