1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. gmmg

Beiträge von gmmg

  • Email VersandSystem für Gutscheine

    • gmmg
    • 13. Februar 2019 um 08:36

    Hier ein Beispiel zum Auslesen einer Excel Datei

    C
    #include <Excel.au3>
    #include <Array.au3>
    
    $sExcelFile = @ScriptDir & "\test.xlsx"
    
    ; excel auslesen
    Local $oExcelapp = _Excel_Open(0,0,1,1,1)
    Local $oExcel = _Excel_BookOpen($oExcelapp, $sExcelFile)
    
    If @error = 1 Then
        MsgBox(0, "Error!", "Unable to Create the Excel Object")
        Exit
    ElseIf @error = 2 Then
        MsgBox(0, "Error!", "File does not exist - Shame on you!")
        Exit
    EndIf
    
    Local $aArray = _Excel_RangeRead($oExcel,Default,Default)
    
    _Excel_BookClose($oExcel, False)
    _Excel_Close($oExcelapp, Default, True)
    
    _ArrayDisplay($aArray, "Array using Default Parameters")
    
    For $i = 0 To UBound($aArray) -1
    
        MsgBox(0,"Zeile " & $i , $aArray[$i][0] & @crlf & $aArray[$i][1] & @crlf & $aArray[$i][2])
    
    Next
    Alles anzeigen

    Im Anhang eine Beispiel Excel Datei als ZIP

    Gruß gmmg

    Dateien

    Test.zip 6,18 kB – 524 Downloads
  • Email VersandSystem für Gutscheine

    • gmmg
    • 12. Februar 2019 um 14:56

    Wie macht ihr denn die Zuordnung Gutschein <-> Kunde? Das braucht man doch für eine spätere Auswertung.

    Entweder man weißt in der Excel jedem Kunden schon einen Gutschein explizit zu ( das wäre der einfache Weg) oder man greift auf einem Pool von Gutscheinen (PDF Dateinen) zurück, (hier wird jeweils ein Gutschein angehangen) und dieser muss dann nach dem Versand verschoben und entsprechend dem Kunden umbenannt werden? Das hat den Nachteil, man muss hinterher die Gutscheine nochmals anfassen, um die Zuordnung in die Excel zu bringen. Auch wieder für Auswertungen.

    Wie heißen denn die Einzelnen Gutscheine (PDF Name)? Bitte die Daten verfälschen. Normalerweise verschickt man ja die Daten so, dass die PDF nur Gutschein.pdf heißt und in der Datei dann der Gutscheincode steht.

    Gruß gmmg

  • Email VersandSystem für Gutscheine

    • gmmg
    • 12. Februar 2019 um 13:01

    Hallo Springstil,

    wie "alpines" schon erwähnt hat ist das kein Problem.

    Ich bevorzuge bei meinem Scripten den Versand per SMTP. Ein Exchange Server ist ja vorhanden, wie du schreibst.

    Die Email Adressen sollten in einer Datenbank oder in einer Excel Datei vorliegen.

    Soll der Kunde dann noch im Text mit Namen angesprochen werden, werden natürlich auch die weiteren Kundendaten (Name, Vorname) benötigt.

    Aufbau der Gutscheine -> Hat jeder Kunde einen bestimmten oder sollen die zufällig versendet werden. Die Gutscheinnummer muss dann dem Kunden zugeordnet werden.

    Also Wichtig ist, wie liegen die Daten vor und wie soll die Zuordnung zum Gutschein erfolgen. Dann wäre noch wichtig, mit welchem User die Daten per Script versendet werden und welche Absender Mailadresse genutzt werden soll.

    Im Script selbst werden dann die Daten eingelesen und in einer Schleife abgearbeitet.

    Hier mal das SMTP Script als Beispiel

    C
    #include <File.au3>
    #include <String.au3>
    #Include <Array.au3>
    #include <WindowsConstants.au3>
    
    Local $oMyRet, $oMyError, $to, $cc, $bcc, $subject, $body, $attachment, $aRecords, $body_txt
    
    $MAILSERVER = ""
    $ADMINUSER = ""
    $ADMINPASS = ""
    
    $from = ""
    $to = ""
    $cc = ""
    $bcc = ""
    $subject = ""
    $body = ""
    $attachment = ""
    
    Sendmail()
    
    sleep (2000)
    
    Func Sendmail()
    
        ;MsgBox(0,"", $strData2)  ;mailadresse prüfen
    
        Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
        ;##################################
        ; Variables
        ;##################################
        
        $s_SmtpServer = $MAILSERVER                 ; address for the smtp-server to use - REQUIRED
        $s_FromName = $from                         ; name from who the email was sent
        $s_FromAddress = $from                         ; address from where the mail should come
        $s_ToAddress = $to                            ; destination address of the email - REQUIRED
        $s_Subject = $subject                        ; subject from the email - can be anything you want it to be
        $as_Body = $body_txt                        ; the messagebody from the mail - can be left blank but then you get a blank mail
        $s_AttachFiles = $attachment                ; the file you want to attach- leave blank if not needed
        $s_CcAddress = $cc                             ; address for cc - leave blank if not needed
        $s_BccAddress = $bcc                         ; address for bcc - leave blank if not needed
        $s_Username = $ADMINUSER                      ; username for the account used from where the mail gets sent  - Optional (Needed for eg GMail)
        $s_Password = $ADMINPASS                      ; password for the account used from where the mail gets sent  - Optional (Needed for eg GMail)
        $IPPort = 25                                 ; port used for sending the mail
        $ssl = 0                                     ; enables/disables secure socket layer sending - put to 1 if using httpS
        ;~ $IPPort=465                                ; GMAIL port used for sending the mail
        ;~ $ssl=1                                     ; GMAILenables/disables secure socket layer sending - put to 1 if using httpS
    
        ;##################################
        ; Script
        ;##################################
        Global $oMyRet[2]
        ;MsgBox(0,"", $s_SmtpServer& $s_FromName& $s_FromAddress& $s_ToAddress& $s_Subject& $as_Body& $s_AttachFiles& $s_CcAddress& $s_BccAddress& $s_Username& $s_Password& $IPPort& $ssl)
        $rc = _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, $s_AttachFiles, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl)
        If @error Then
            MsgBox(0, "Error sending message", "Error code:" & @error & "  Description:" & $rc,1)
        EndIf
    
    EndFunc   ;==>Sendmail
    
    
    Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0)
        $objEmail = ObjCreate("CDO.Message")
        $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
        $objEmail.To = $s_ToAddress
        Local $i_Error = 0
        Local $i_Error_desciption = ""
        If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress
        If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress
        $objEmail.Subject = $s_Subject
        If StringInStr($as_Body, "<") And StringInStr($as_Body, ">") Then
            $objEmail.HTMLBody = $as_Body
        Else
            $objEmail.Textbody = $as_Body & @CRLF
        EndIf
        If $s_AttachFiles <> "" Then
            Local $S_Files2Attach = StringSplit($s_AttachFiles, ";")
            For $x = 1 To $S_Files2Attach[0]
                $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x])
                If FileExists($S_Files2Attach[$x]) Then
                    $objEmail.AddAttachment($S_Files2Attach[$x])
                Else
                    $i_Error_desciption = $i_Error_desciption & @LF & 'File not found to attach: ' & $S_Files2Attach[$x]
                    SetError(1)
                    Return 0
                EndIf
            Next
        EndIf
        $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer
        $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort
        ;Authenticated SMTP
        If $s_Username <> "" Then
            $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
            $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username
            $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password
        EndIf
        If $ssl Then
            $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
        EndIf
        ;Update settings
        $objEmail.Configuration.Fields.Update
        ; Sent the Message
        $objEmail.Send
        If @error Then
            SetError(2)
            Return $oMyRet[1]
        EndIf
    EndFunc   ;==>_INetSmtpMailCom
    
    Func MyErrFunc()
        $HexNumber = Hex($oMyError.number, 8)
        $oMyRet[0] = $HexNumber
        $oMyRet[1] = StringStripWS($oMyError.description, 3)
        ConsoleWrite("### COM Error !  Number: " & $HexNumber & "   ScriptLine: " & $oMyError.scriptline & "   Description:" & $oMyRet[1] & @LF)
        SetError(1); something to check for when this function returns
        Return
    EndFunc   ;==>MyErrFunc
    Alles anzeigen

    Gruß gmmg

  • Rechentool GUI Fragen

    • gmmg
    • 23. Januar 2019 um 09:42

    Hallo Elysium,

    vielleicht schreibst du mal ein Paar Standard Werte für deine Felder und mit Welcher Rechenart diese berechnet werden sollen.

    Ich selbst kenne die Worte Formnestzahl und Zykluszeit nur aus dem Formenbau, habe damit aber noch nie gearbeitet.

    Gruß gmmg

  • Internetseite auslesen und dann?

    • gmmg
    • 14. Dezember 2018 um 08:48

    Hallo Code4Fun,

    dazu gibt es schon einige Beispiel, entweder hier oder im engl. Forum.

    Z.B. Kannst du bei google nach sowas suchen: Website-AutoLogin with Internet Explorer

    Arbeite dich in das Thema ein und wenn du dann noch Fragen hast, wird dir sicher geholfen :)

    Wie Code-Jack schon erwähnt hat, immer darauf achten was man macht und ob es im Rahmen des Legalen ist.

    Gruß gmmg

  • IE Fentser in GUI Darstellen

    • gmmg
    • 13. Dezember 2018 um 10:19

    ok, werde es mal testen :)

  • IE Fentser in GUI Darstellen

    • gmmg
    • 12. Dezember 2018 um 10:39

    Hallo Zusammen,

    hier mal ein kleines Skript, welches ein IE Fenster in einer GUI darstellt.

    Ein Problem war, dass _IECreateEmbedded als Browseremulation nicht den IE 11 nutzt, somit war kein JavaScript verfügbar.

    Meine Frage an Euch, lässt sich hier noch etwas verbessern?

    Spoiler anzeigen
    C
    #include <GUIConstantsEx.au3>
    #include <IE.au3>
    #include <WindowsConstants.au3>
    #include <EditConstants.au3>
    
    #NoTrayIcon
    
    $tWorkArea = DllStructCreate("long Left;long Top;long Right;long Bottom")
    
    DllCall("user32.dll", "bool", "SystemParametersInfoW", "uint", 48, "uint", 0, "ptr", DllStructGetPtr($tWorkArea), "uint", 0)
    ;MsgBox(0,"", DllStructGetData($tWorkArea, "Right") & @crlf & DllStructGetData($tWorkArea, "Bottom"))
    
    $DesktopWidth = DllStructGetData($tWorkArea, "Right")
    $DesktopHeight = DllStructGetData($tWorkArea, "Bottom")
    
    $URL = "https://www.google.de"
    
    ;Local $oIE = ObjCreate("Shell.Explorer.2")
    $oIE = _IECreateEmbedded()
    
    If @Compiled Then
        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", @ScriptName, "REG_DWORD", 11001)
    Else
        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", "AutoIt3.exe", "REG_DWORD", 11001)
        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", "autoit3_x64.exe", "REG_DWORD", 11001)
    EndIf
    
    $CosmonoutGUI = GUICreate("", $DesktopWidth, $DesktopHeight, 0,0)
    
    GUICtrlCreateObj($oIE, 1, 1, $DesktopWidth, $DesktopHeight -30)
    ;$oIE.navigate($URL)
    _IENavigate($oIE, $URL)
    $title = _IEPropertyGet($oIE, "title")
    WinSetTitle($CosmonoutGUI, "", $title)
    Sleep(500)
    GUISetState(@SW_SHOW) ;Show GUI
    
    
    While 1
        $iMsg = GUIGetMsg()
        Switch $iMsg
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd
    
    If Not @Compiled Then
        RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", "AutoIt3.exe")
        RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", "autoit3_x64.exe")
    EndIf
    
    GUIDelete()
    Exit
    Alles anzeigen

    Gruß gmmg :)

  • Mit Uhrzeiten rechnen

    • gmmg
    • 2. November 2018 um 09:40

    Hallo Mikki,

    ich denke mal da muss sogar das richtige Datum rein. Welches du z.B. so umformatieren kannst.

    ;Beispiel

    #include <Array.au3>

    MsgBox(0,"", _NowDate())

    $nowDate_array = StringSplit(_NowDate(),".")

    _ArrayDisplay($nowDate_array )

    $nowDate_new = $nowDate_array [3] & "/" & $nowDate_array [2] & "/" & $nowDate_array [1]

    MsgBox(0,"",$nowDate_new)

    $Arbeit = _DateDiff('s', $nowDate_new & " " & $aNowTime[0], $nowDate_new & " " & $aNowTime[3])

    Die Variable $nowDate wird von dir schon genutzt, deshalb habe ich die mal $nowDate_new genannt.

    Gruß gmmg

  • Mit Uhrzeiten rechnen

    • gmmg
    • 2. November 2018 um 09:20

    Hallo Mikki,

    bei dir fehlt das Datum in der Berechnung.

    $Arbeit = _DateDiff('s', "1970/01/01 " & $aNowTime[0], "1970/01/01 " & $aNowTime[3])

    Gruß gmmg

  • Internet sperren für Prüfungssituationen

    • gmmg
    • 29. Oktober 2018 um 13:09

    Einen Proxy zu setzen ist ja bei Windows nun per Registry nicht schwer.

    Wir nutzen im Unternehmen für die Azubis das Tool "netop Vision" (Klassenraum Managment Software). Hier fallen allerdings Lizenzgebühren an.

    Gruß gmmg

  • SQL-Abfrage in For-Schleife

    • gmmg
    • 19. September 2018 um 08:42

    super :)

    gruß gmmg

  • SQL-Abfrage in For-Schleife

    • gmmg
    • 13. September 2018 um 13:24

    Hier hab ich mal ein Script aus meiner Sammlung. (Nutzt die Libmysql.dll)

    C
    #include <array.au3>
    #include <mysql.au3>
    
    ; db verbindungsvariablen
    $ipadd = "server"
    $sname = "user"
    $spasswort = "pwd"
    $db = "datenbank"
    
    _MySQL_InitLibrary()
    If @error Then Exit MsgBox(0, "Fehler", "libmysql.dll nicht gefunden")
    
    $MysqlConn = _MySQL_Init()
    
    $connected = _MySQL_Real_Connect($MysqlConn,$ipadd,$sname,$spasswort,$db)
    
    If $connected = 0 Then
        $errno = _MySQL_errno($MysqlConn)
        MsgBox(0,"Fehler","Login Server ist nicht Erreichbar")
        Exit
    Endif
    
    Local $sQuery = "SELECT * FROM `Tabelle1`"
    ;MsgBox(0,"",$sQuery)
    
    _MySQL_Real_Query($MysqlConn, $sQuery)
    
    $res = _MySQL_Store_Result($MysqlConn)
    $array = _MySQL_Fetch_Result_StringArray($res)
    _MySQL_Free_Result($res)
    
    _ArrayDisplay($array)
    
    
    For $i = 0 To UBound($array) - 1
            
        Local $sQuery1 = 'SELECT * FROM Tabelle2 where Feld2="' & $array[$i][4] & '"' ;Der wert aus Feld2 wird auf Übereinstimmung mit dem ArrayFeld 4 (erste Abfrage) geprüft.
        
        _MySQL_Real_Query($MysqlConn, $sQuery1)
    
        $res1 = _MySQL_Store_Result($MysqlConn)
        $array1 = _MySQL_Fetch_Result_StringArray($res1)
        _MySQL_Free_Result($res1)
    
        _ArrayDisplay($array1)
    
    Next
    
    
    ; Verbindung beenden
    _MySQL_Close($MysqlConn)
    ; MYSQL beenden
    _MySQL_EndLibrary()
    Alles anzeigen

    Falls du das nutzen möchtest, du benötigst dann nur noch die erzeugte Exe und die libmysql.dll.

    Die Einrichtung des ODBC Treibers fällt weg.


    Gruß gmmg

    Dateien

    MYSQL.7z 2,25 MB – 450 Downloads
  • SQL-Abfrage in For-Schleife

    • gmmg
    • 13. September 2018 um 12:18

    Hallo bordermax,

    hast du dir deine Select Anweisung "Query1" mal in der Console ausgeben lassen und diese dann in der MYSQL Query /MYSQL Administrator abgeschickt.

    Bekommst du da ein Ergebnis zurück? Eventuell ist es ein Formatierungsfehler.

    Gruß gmmg

  • Wie führe ich mit der Datenträgerverwaltung zwei Partitionen zusammen?

    • gmmg
    • 13. August 2018 um 15:13

    Hi (auto)Bert,

    falls Windows das nicht kann, gibt es noch die Möglichkeit mit der GPartet Live CD (Live Linux) die Partitionen zu löschen.

    Danach einfach mit Windows wieder eine neue Partition über die komplette Größe erstellen. fertsch ...

    Gruß gmmg :)

  • Koordinaten umrechnen (unbekanntes Schema => Google-Maps)

    • gmmg
    • 24. Juli 2018 um 15:28

    schau mal hier, da hast du verschiede Umrechnungsmöglichkeiten

    Die Meridiankoordinaten 3490289,71 5384226,86 finde ich unter dem System nach Gauß-Krüge.

    https://www.deine-berge.de/Rechner/Koordinaten/Dezimal/51,10

    Gruß gmmg

  • Hallo an alle

    • gmmg
    • 25. Mai 2018 um 10:35

    Ein Herzliches Willkommen auch von mir :)

    Gruß gmmg

  • WinAPICom.au3 Fehler $sProgID: possibly used before declaration

    • gmmg
    • 26. April 2018 um 14:55

    Hallo Bugfix,

    in der Version 3.3.14.2 läuft mein Script ohne Fehlermeldung.

    Erst in den folgenden Version 3.3.14.3 und der 3.3.14.5 kommt es zu diesem Fehler.

    Ich bin aber jetzt erstmal zurück auf die 3.3.14.2.

    Beide Versionen der WinAPICom.au3 habe ich mal verglichen, da ist außer der Versionsnummer nichts anders.

    Was mir auffällt, im Script kommen nur die folgenden WinAPI Funktionen vor.

    Der Fehler kommt bestimmt deswegen, weil die WinAPI.au3 nicht als Include eingebunden ist.

    AutoIt
    Func _Putty()
    
        $hPid = Run(@ScriptDir & '\putty.exe -load "Programm" -l user -pw ' & $pwd,"",@SW_HIDE)
        WinWait("[CLASS:PuTTY]", "", 5)
        $hChild = WinGetHandle("[CLASS:PuTTY]", "")
        $NEXSTYLE = DllCall("user32.dll", "int", "GetWindowLong", "hwnd", $hChild, "int", 236)
        DllCall("user32.dll", "int", "SetWindowLong", "hwnd", $hChild, "int", 236, "int", BitOR($NEXSTYLE[0], $WS_EX_MDICHILD))
        DllCall("user32.dll", "int", "SetParent", "hwnd", $hChild, "hwnd", $hGui)
    
        $iOldStyle = _WinAPI_GetWindowLong($hChild, $GWL_STYLE)
        $iNewStyle = BitXOr($iOldStyle, $WS_SYSMENU);$WS_MINIMIZEBOX, $WS_MAXIMIZEBOX)
        _WinAPI_SetWindowLong($hChild, $GWL_STYLE, $iNewStyle)
    
        _WinAPI_SetWindowRgn(WinGetHandle($hChild), _WinAPI_CreateRectRgn(0, 30, 1024, 768)) ; Cut off Window Border
    
        WinMove($hChild, "", -8, 50,675,424)
        _WinAPI_ShowWindow($hChild, @SW_SHOW)
    
    EndFunc
    Alles anzeigen


    Gruß gmmg

  • WinAPICom.au3 Fehler $sProgID: possibly used before declaration

    • gmmg
    • 26. April 2018 um 12:04

    Hallo Zusammen,

    in der neuen Autoit Version 3.3.14.5 erhalte ich den folgenden Fehler. Muss die $sProgID vorher deklariert werden? In der vorheriogen Version lief alles ohne ersichtliche Fehler durch.

    https://www.autoitscript.com/site/autoit/downloads/

    "C:\Program Files (x86)\AutoIt3\Include\WinAPICom.au3"(46,38) : warning: $sProgID: possibly used before declaration.

    Func _WinAPI_CLSIDFromProgID($sProgID)

    Danke

    Gruß gmmg

  • Windows Aktivierung Status

    • gmmg
    • 18. April 2018 um 15:24

    Beide Scripte geben bei mir eine Info zur Aktivierung von Windows zurück

    (Windows 7 X64 )


    Code
    Global $ActiveCheck, $result
    
    If @OSVersion = "WIN_2000" Or @OSVersion = "WIN_2003" Or @OSVersion = "WIN_XP" Or @OSVersion = "WIN_XPe" Then
    $ActiveCheck = _XPActivationCheck()
    Else
    $ActiveCheck = _ActivationStatus()
    EndIf
    
    Func _ActivationStatus() ; Vista + Only ~ author trancexx
        Local $oWMIService = ObjGet("winmgmts:\\.\root\cimv2")
        If IsObj($oWMIService) Then
        Local $oCollection = $oWMIService.ExecQuery("SELECT Description, LicenseStatus, GracePeriodRemaining FROM SoftwareLicensingProduct WHERE PartialProductKey <> null")
        If IsObj($oCollection) Then
        For $oItem In $oCollection
        Switch $oItem.LicenseStatus
        Case 0, 2 To 4, 6
        $result = "Windows Is NOT Activated"
        Case 1
        $result = "Windows Is Activated"
        Case 5
        $result = "Possible Fixed Windows (Notification Mode)"
        EndSwitch
        ;~ Return ConsoleWrite( $result & @CRLF)
        Return MsgBox(0, "Activation Result", $result & @CRLF)
        Next
        EndIf
        EndIf
    EndFunc ;==>_ActivationStatus
    
    Func _XPActivationCheck() ; XP only
        Local $x = ObjGet("winmgmts:{impersonationLevel=impersonate}")
        Local $y = $x.InstancesOf("win32_WindowsProductActivation")
        For $Obj In $y
        If $Obj.ActivationRequired Then
        $result = 'Windows Is NOT Activated'
        Else
        $result = 'Windows Is Activated'
        EndIf
        Next
        ;~ Return ConsoleWrite( $result & @CRLF)
        Return MsgBox(0, "Activation Result", $result & @CRLF)
    EndFunc ;==>_XPActivationCheck
    
    
    
    $WMI = ObjGet("winmgmts:\\.\root\cimv2")
    $aLicenses = $WMI.ExecQuery("Select * From SoftwareLicensingProduct")
    
       For $element In $aLicenses
          If StringInStr($element.Description, "Windows Operating System") Then
             If $element.GracePeriodRemaining = 0 Then
                MsgBox(0, "", "Product is Activated")
                ExitLoop
             Else
                ;Call SLMgr.vbs with your selected options
                ;http://technet.microsoft.com/en-us/library/ff793433.aspx
             EndIf
          EndIf
       Next
    Alles anzeigen

    Gruß gmmg

  • Windows Aktivierung Status

    • gmmg
    • 18. April 2018 um 13:57

    Hallo AutoMit,

    schau mal hier im engl. Forum

    https://www.autoitscript.com/forum/topic/14…7-is-activated/

    Gruß gmmg

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™