Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/09/2016 in all areas

  1. Xandy

    run command not run

    Macro documentation: https://www.autoitscript.com/autoit3/docs/macros.htm ?
    1 point
  2. @Irios if you're looking for both the property name and the value in a single pass I would do something like this: Local $oWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Local $oItems = $oWMI.ExecQuery("Select * FROM Win32_PerfRawData_Tcpip_NetworkInterface") For $sItem In $oItems For $sProperty In $sItem.Properties_ ConsoleWrite($sProperty.Name & ": " & $sProperty.Value & @CRLF) Next Next Just be aware that some properties may return an array rather than a string. So you might have to code a For loop to gather all the values.
    1 point
  3. Hi @Irios perhaps you can try WMI Explorer. Its a tool for displaying WMI Namespaces, Classes and Properties. WMI Explorer A Way to get both the property and value written to the console is in the example below. Local $objWMIService = ObjGet("winmgmts:\\" & "." & "\root\CIMV2") Local $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_PerfRawData_Tcpip_TCP") If IsObj($colItems) then For $objItem In $colItems ConsoleWrite ("Caption: " & $objItem.Caption & @CRLF ) ConsoleWrite ("ConnectionFailures: " & $objItem.ConnectionFailures & @CRLF ) ConsoleWrite ("ConnectionsActive: " & $objItem.ConnectionsActive & @CRLF ) ConsoleWrite ("ConnectionsEstablished: " & $objItem.ConnectionsEstablished & @CRLF ) ConsoleWrite ("ConnectionsPassive: " & $objItem.ConnectionsPassive & @CRLF ) ConsoleWrite ("ConnectionsReset: " & $objItem.ConnectionsReset & @CRLF ) ConsoleWrite ("Description: " & $objItem.Description & @CRLF ) ConsoleWrite ("Frequency_Object: " & $objItem.Frequency_Object & @CRLF ) ConsoleWrite ("Frequency_PerfTime: " & $objItem.Frequency_PerfTime & @CRLF ) ConsoleWrite ("Frequency_Sys100NS: " & $objItem.Frequency_Sys100NS & @CRLF ) ConsoleWrite ("Name: " & $objItem.Name & @CRLF ) ConsoleWrite ("SegmentsPersec: " & $objItem.SegmentsPersec & @CRLF ) ConsoleWrite ("SegmentsReceivedPersec: " & $objItem.SegmentsReceivedPersec & @CRLF ) ConsoleWrite ("SegmentsRetransmittedPersec: " & $objItem.SegmentsRetransmittedPersec & @CRLF ) ConsoleWrite ("SegmentsSentPersec: " & $objItem.SegmentsSentPersec & @CRLF ) ConsoleWrite ("Timestamp_Object: " & $objItem.Timestamp_Object & @CRLF ) ConsoleWrite ("Timestamp_PerfTime: " & $objItem.Timestamp_PerfTime & @CRLF ) ConsoleWrite ("Timestamp_Sys100NS: " & $objItem.Timestamp_Sys100NS & @CRLF ) Next Else Msgbox (48, "WMI Error", "WMI Error") Endif
    1 point
  4. One of the many ways #include <Array.au3> Local $sProductID = "B01BGFBUC4" ; //Amazon product ID Local $sURL = "http://www.amazon.com/One-Persons-Craziness-R-T-Ojas-ebook/product-reviews/" & $sProductID & "/ref=cm_cr_dp_see_all_btm?ie=UTF8&showViewpoints=1&sortBy=bySubmissionDateDescending&filterByStar=two_star"; Local $sSource = BinaryToString(InetRead($sURL, 1)) Local $sReview = StringRegExp($sSource, '(?:<span class="a-size-base a-color-secondary review-date">)(.*?)(?:</span>)', 3) If Not @error And IsArray($sReview) Then _ArrayDisplay($sReview, "DEBUG") MsgBox(0, "Last review", $sReview[UBound($sReview) - 1]) EndIf
    1 point
  5. The WM_NOTIFY uses the $tagNMLVCUSTOMDRAW structure (c.f. helpfile) . Please note this : clrText : COLORREF value representing the color that will be used to display text foreground in the list-view control. Microsoft says : " The COLORREF value is used to specify an color. When specifying an explicit RGB color, the COLORREF value has the following hexadecimal form: 0x00bbggrr " reason why our usual 0xrrggbb color needs to be converted with RGB2BGR() before use in the wm_notify
    1 point
  6. Malkey

    Regex date

    If you do not want the delimliter and year only to be specifically matched then make that part of the RE pattern a non-capturing group. See example. #include <Array.au3> Local $sString = StringRegExpReplace(FileRead(@ScriptFullPath), "(?is)^.*#cs\R|\R?#ce.*$", "") ; ClipGet() ConsoleWrite($sString & @CRLF) $a = StringRegExp($sString, "((?:[0-9]{1,2}[\h\-\\/.]{0,3}){2,3})", 3) _ArrayDisplay($a) ; Modified $aDelim from Post#1 $aDelim = StringRegExp($sString, '(\d{1,2}\s?[\055|\056|\057|\134]\s?\d{1,2}(?:\s?[\055|\056|\057|\134]\s?\d{2,4})?)', 3) ; Note addition of "?:" in the RegExp pattern in the line above here~~~~~~~~~^ _ArrayDisplay($aDelim, "$aDelim") ; Data for variable $sString - Copied from Post#1 #cs 02 / 9 \ 16 – test 07 - 9 . 16 – test 09/9/16 – test 14\9\16 – test 16-9-16 – test 21.9.16 – test 23/9 – test 28\9 – test #ce
    1 point
  7. jchd

    Regex date

    I find it rare that people use octal nowadays, in regexp patterns or elsewhere.
    1 point
  8. Just one optimization note: Always use parameter CaseSense=1 in StringInStr() or StringReplace() when there are searched/tested/replaced non a-z,A-Z strings. This way you can achieve BIG speed boost! EDIT: Of course also use case sensitive string comparison in IF ... THEN: If string1 == string2 Then ... instead of much slower NOT case sensitive one: If string1 = string2 Then ...
    1 point
×
×
  • Create New...