Jump to content

brian gonzalez

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by brian gonzalez

  1. updated code: $o_NetTraffic = $o_WMIService.ExecQuery("SELECT NAME, BytesReceivedPersec, BytesSentPersec FROM" & _ " Win32_PerfFormattedData_Tcpip_NetworkInterface" & _ " WHERE Name LIKE '%" & $AdapterStr & "%'", "WQL", 0) MsgBox(0,"",$o_NetTraffic.Count ;displays amount of elements in returned object. That Worked ! Thanks for the quick response ! .. would you happen to know what Win32 class would store the current throughput of a USB transfer ? That is my next project.
  2. I am querying WMI for current throughput of my NIC adapters.. Basically looking to make a lite, compiled (.exe) network monitor for WinPE3x (Win7 PE).. I intend on using this monitor during an MDT or SCCM deployment to ensure traffic is being moved at an adequate speed. Problem: 1. I can not verify that the pulled object is valid, IsObject ALWAYs returns a "True" even if the Query results are empty. 2. Can not use ".count" property listed in the Win32_Class in on ms's site. Any Help towards this project is much appreciated ! *FYI: I also want to make a similar monitor for transfer via USB. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=C:\support\script\network-icons\icons\Network ID SH.ico #AutoIt3Wrapper_outfile=display-net-traffic.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Local $wbemFlagReturnImmediately= 0x10 Local $wbemFlagForwardOnly = 0x20 Local $h_wbemFlags = $wbemFlagReturnImmediately + $wbemFlagForwardOnly $s_ComputerName = "localhost" $o_WMIService = ObjGet("winmgmts:\\" & $s_ComputerName & "\root\CIMV2") SplashTextOn("Network Traffic Monitor","Network Traffic Monitor",300,100,0,0,9,"arial",10,600) For $i = 0 To 1000 $o_NetTraffic = $o_WMIService.ExecQuery("SELECT NAME, BytesReceivedPersec, BytesSentPersec FROM Win32_PerfFormattedData_Tcpip_NetworkInterface WHERE Name LIKE '%Network%'", "WQL", $h_wbemFlags) If IsObj($o_NetTraffic) Then For $o_item in $o_NetTraffic Round(FileGetSize("C:\Windows\UNSIPPS.exe")/1048576,2) $message = StringStripWS ( $o_item.Name, 3 ) & @CRLF & @CRLF & _ Round($o_item.BytesReceivedPersec/1048576,2) & " MB/sec rece" & @CRLF & _ Round($o_item.BytesSentPersec/1048576,2) & " MB/sec sent" ControlSetText("Network Traffic Monitor","","Static1", $message) Sleep(1000) Next ;Else ; ControlSetText("Network Traffic Monitor","","Static1", "No Module Found...") ; Sleep(5000) ; ExitLoop Else ControlSetText("Network Traffic Monitor","","Static1", "Object doesn't exist? ..") Sleep(5000) EndIf Next
  3. Would this dll work in WinPE 2 ?
  4. This still doesnt seem to work.. I got this to work, but it displays the text boxes when it copies the files.. Id much rather not show that.... ;RunWait(@COMSPEC & " /c %temp%\batch\7za.exe e %temp%\batch\WebIfas.zip -oc:\WebIfas\ -aoa") ;RunWait(@COMSPEC & " /c %temp%\batch\7za.exe e %temp%\batch\Dialers.zip -o%temp%\batch\Dialers\ -aoa")
  5. RunWait("%temp%\batch\7za.exe e %temp%\batch\WebIfas.zip -oc:\WebIfas\ -aoa", @WindowsDir, @SW_HIDE) error: >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\AutoIt\config.au3" C:\AutoIt\config.au3 (58) : ==> Unable to execute the external program.: RunWait("%temp%\batch\7za.exe e %temp%\batch\WebIfas.zip -oc:\WebIfas\ -aoa", @WindowsDir, @SW_HIDE) The parameter is incorrect. Any ideas?
×
×
  • Create New...