Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/02/2015 in all areas

  1. Try something like this. It returns all properties, but you could easily have it check only for the ones you want: $sMSI = FileOpenDialog("MSI Properties", @ScriptDir, "Windows Installer Files (*.msi)") $oInstaller = ObjCreate("WindowsInstaller.Installer") $oDB = $oInstaller.OpenDataBase($sMSI, 0) $oView = $oDB.OpenView("SELECT Property,Value FROM Property") $oView.Execute() $oCount = 0 While @error = 0 $oRecords = $oView.Fetch $oPropValue = $oRecords.StringData(2) $oPropName = $oRecords.StringData(1) If $oPropName <> "" Then $oCount += 1 ConsoleWrite($oPropName & " = " & $oPropValue & @CRLF) EndIf WEnd
    1 point
  2. LondonNDIB, We generally prefer that you start a new thread and link to the old one if really necessary. We say this for two main reasons: - 1. The language advances and the functionality asked for in old threads might well be included in core or UDF code by now. - 2. The changes in language syntax mean that it is likely that code from more than a couple of years ago may well not run under the current release interpreter without significant modification. I realise that is not the case here, but we would still be grateful if you could try to fit in with our way of doing things. M23
    1 point
  3. I think you need to re-read that post! - end of discussion - Jos
    1 point
  4. Calm down. I see a vb6 example and ported to AutoIt. #RequireAdmin Func EnableDisableICS($sPublicConnectionName,$ssPrivateConnectionName,$bEnable) Local $bFound =False Dim $oNetSharingManager, $oConnectionCollection, $oItem, $EveryConnection, $objNCProps $oNetSharingManager = ObjCreate("HNetCfg.HNetShare.1") $oConnectionCollection = $oNetSharingManager.EnumEveryConnection For $oItem In $oConnectionCollection $EveryConnection = $oNetSharingManager.INetSharingConfigurationForINetConnection($oItem) $objNCProps = $oNetSharingManager.NetConnectionProps($oItem) If $objNCProps.name = $ssPrivateConnectionName Then $bFound = True ;~ MsgBox(0,"","Starting Internet Sharing For: " & $objNCProps.name) If $bEnable Then $EveryConnection.EnableSharing(1) Else $EveryConnection.DisableSharing() EndIf EndIf Next $oConnectionCollection = $oNetSharingManager.EnumEveryConnection For $oItem In $oConnectionCollection $EveryConnection = $oNetSharingManager.INetSharingConfigurationForINetConnection($oItem) $objNCProps = $oNetSharingManager.NetConnectionProps($oItem) If $objNCProps.name = $sPublicConnectionName Then $bFound = True ;~ MsgBox(0,"","Internet Sharing Success For: " & $objNCProps.name) If $bEnable Then $EveryConnection.EnableSharing(0) Else $EveryConnection.DisableSharing() EndIf EndIf Next Return $bFound EndFunc MsgBox(0,"",EnableDisableICS("YOUR ACTIVE NETWORK", "OUR ADAPTOR TO SHARE", True)) Saludos .
    1 point
  5. I'd be willing to bet those settings are stored in the registry. I'm not at a place where I can test this, but I'd recommend using procmon to see what registry keys are being set and try setting them via your autoit script. It may take a disable/enable of the network interface for the changes to take effect. Just my two cents
    1 point
  6. for more complex urls, you can use something like this regex : Local $aUrl[9] = ["http://server:12345/path/blabla", _ "http://server.com:1234/path?query_string#fragment_id", _ "ftp://user:password@server:1234/path", _ "ftp://user@server:1234/path", _ "http://www.server.com", _ "www.server.com/path", _ "server.com", _ "http://user@server.com:1234/path?query_string#fragment_id", _ "user@server.com:1234" ] Local $sPattern = "^(?i)(?:(?:[a-z]+):\/\/)?" & _ ; Protocol "(?:(?:(?:[^@:]+))" & _ ; Username "(?::(?:[^@]+))?@)?" & _ ; Password "([^\/:]+)" & _ ; Host "(?::(?:\d+))?" & _ ; Port "(?:\/(?:[^?]+)?)?" & _ ; Path "(?:\?\N+)?" ; Query For $i = 0 To UBound($aUrl) - 1 $aHost = StringRegExp($aUrl[$i], $sPattern, 1) ConsoleWrite($aHost[0] & @TAB & $aUrl[$i] & @CRLF) Next https://regex101.com/r/yB3dO1/1
    1 point
  7. I think a better question would be: How does that regular expression work? There are two groups: (.+?) ..... any characters repeated any number of times in any order. (.w+)z ..... one dot followed by any word characters until the end of the string. Googlers can fathom it out for themselves.
    1 point
  8. Thanks, AutoIt is the best language ever!
    1 point
×
×
  • Create New...