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. Helveticus

Beiträge von Helveticus

  • Problem bei der Ausführung eines Skripts

    • Helveticus
    • 19. Mai 2010 um 11:45

    Habs korrigiert. Vielleicht hat jemand ja einen besseren SMTP Mailer, mit dem es funktioniert.

  • In Administratoraccount wechseln

    • Helveticus
    • 19. Mai 2010 um 11:41

    Das funktioniert nicht. Das Skript wird dann zwar mit Administratorrechten ausgeführt, ich muss es aber im Administratoraccount ausführen.

  • In Administratoraccount wechseln

    • Helveticus
    • 19. Mai 2010 um 11:08

    Hallo

    Ich habe folgendes Problem. Ich möchte eine reg-Datei eintragen. Dazu rufe ich eine xxx.cmd auf und diese übernimmt dann alles. Das Problem ist, dass das Programm im Administratoraccount ausgeführt werden muss. Wenn ich sie im Benutzeraccount ausführe funktioniert es zwar, aber die Werte werden nicht richtig gesetzt bzw. an der falschen Stelle, auch wenn ich sie mit Administratorrechten im Benutzeraccount ausführe.

    Seht ihr da eine Lösung?

    Das Einzige was ich sehe, ist dass ich in den Administratoraccount wechsle, aber wie mache ich das mit AutoIt?

  • Problem bei der Ausführung eines Skripts

    • Helveticus
    • 19. Mai 2010 um 10:50

    Im Anhang noch die 2 Files. Vielleicht kann es ja jemand testen.

    Dateien

    Test.au3 2,23 kB – 223 Downloads
  • Problem bei der Ausführung eines Skripts

    • Helveticus
    • 19. Mai 2010 um 08:37

    Vielen Dank.

    Ich habe die Windows-Firewall ausgeschaltet und es funktioniert immer noch nicht. Komischerweise funktioniert es auf einem anderen PC prima, dort habe ich die Kaspersky Firewall drauf und der wollte es blockieren, habe es aber erlaubt und dann hat es geklappt. Aber beim anderen PC habe ich ja auch die Windowos-Firewall deaktiviert.

    EDIT: Auf dem PC funktionieren Meldungen per SMTP von Avast und Acronis True Image super, bekomme eine E-Mail. Nur bei der Exe von AutoIt funktioniert es nicht.

    EDIT2: Ich habe die Exe jetzt auch noch auf einer virtual machine ausprobiert, auf dem ein sauberes originales XP Prof installiert ist und dort funktioniert es auch nicht, es muss also an AutoIt liegen. Auf dem PC, auf dem es funktioniert, ist AutoIt installiert, auf den anderen PCs nicht. Kann es daran liegen?

    Zitat

    Und was ich dir noch empfehlen möchte: Über dem Editor ist ein Button mit der Aufschrift SP und mit dem AutoIt logo. EInfach mal deinen Quelltext Makieren, dann einmal den AutoIt button drücken, danach einmal den SPButton drücken

    Wo finde ich diese Buttons?

  • Problem bei der Ausführung eines Skripts

    • Helveticus
    • 18. Mai 2010 um 23:31

    Wie meinst du via Dateianhang?

    Das Test.au3 ist das eigentliche Skript, halt ein Testscript.

  • Problem bei der Ausführung eines Skripts

    • Helveticus
    • 18. Mai 2010 um 21:31

    Hier das Skript

    Zuerst die SMTP Mailer.au3


    Spoiler anzeigen
    [autoit]

    #cs ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    AutoIt Version: 3.3.4.0
    Author: Jos (http://www.autoitscript.com/forum/index.php?showtopic=23860)
    Version: 1.0.0
    Date: 24.02.2010

    [/autoit] [autoit][/autoit] [autoit]

    Script Function:
    Template AutoIt script.

    [/autoit] [autoit][/autoit] [autoit]

    #ce ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    #include-once
    #Include<file.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $oMyRet[2]
    Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

    [/autoit] [autoit][/autoit] [autoit]

    Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance="Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0)
    Local $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])
    ConsoleWrite('@@ Debug(62) : $S_Files2Attach = ' & $S_Files2Attach & @LF & '>Error code: ' & @error & @LF) ;### Debug Console
    If FileExists($S_Files2Attach[$x]) Then
    $objEmail.AddAttachment ($S_Files2Attach[$x])
    Else
    ConsoleWrite('!> File not found to attach: ' & $S_Files2Attach[$x] & @LF)
    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
    If Number($IPPort) = 0 then $IPPort = 25
    $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
    ; Set Email Importance
    Switch $s_Importance
    Case "High"
    $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "High"
    Case "Normal"
    $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Normal"
    Case "Low"
    $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Low"
    EndSwitch
    $objEmail.Fields.Update
    ; Sent the Message
    $objEmail.Send
    If @error Then
    SetError(2)
    Return $oMyRet[1]
    EndIf
    $objEmail=""
    EndFunc ;==>_INetSmtpMailCom
    ;
    ;
    ; Com Error Handler
    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

    [/autoit]


    Und jetzt mein Skript Test.au3


    Spoiler anzeigen
    [autoit]

    #cs ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    AutoIt Version: 3.3.4.0
    Author: xxx
    Version: 1.0.1
    Date: 24.02.2010

    [/autoit] [autoit][/autoit] [autoit]

    Script Function:
    Template AutoIt script.

    [/autoit] [autoit][/autoit] [autoit]

    #ce ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    #include "C:\Programmieren\AutoIt\SMTP Mailer.au3"

    [/autoit] [autoit][/autoit] [autoit]

    BlockInput(1)

    [/autoit] [autoit][/autoit] [autoit]

    $SmtpServer = "asmtp.mail.xxx.ch" ; address for the smtp-server to use - REQUIRED
    $FromName = "xxx" ; name from who the email was sent
    $FromAddress = "xxx@xxx.net" ; address from where the mail should come
    $ToAddress = "xxx@xxx.net" ; destination address of the email - REQUIRED
    $Subject = "Test" ; subject from the email - can be anything you want it to be
    $Body = "" ; the messagebody from the mail - can be left blank but then you get a blank mail
    $AttachFiles = "" ; the file you want to attach- leave blank if not needed
    $CcAddress = "" ; address for cc - leave blank if not needed
    $BccAddress = "" ; address for bcc - leave blank if not needed
    $Importance = "Normal" ; Send message priority: "High", "Normal", "Low"
    $Username = "xxx@xxx.net" ; username for the account used from where the mail gets sent - REQUIRED
    $Password = "xxx" ; password for the account used from where the mail gets sent - REQUIRED
    $IPPort = 25 ; port used for sending the mail
    $ssl = 1 ; 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

    [/autoit] [autoit][/autoit] [autoit]

    $Body = "Test"
    $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl)

    [/autoit] [autoit][/autoit] [autoit]

    BlockInput(0)

    [/autoit] [autoit][/autoit] [autoit]

    Exit

    [/autoit]
  • Problem bei der Ausführung eines Skripts

    • Helveticus
    • 18. Mai 2010 um 21:16

    Anscheinend nicht. Also wenn ich in Scite auf Run klicke, dann funktioniert es. Wenn das Skript aber compiliert wird, funktioniert es nicht.

  • Problem bei der Ausführung eines Skripts

    • Helveticus
    • 18. Mai 2010 um 20:35

    Warum funktionierts dann nicht?

  • Problem bei der Ausführung eines Skripts

    • Helveticus
    • 18. Mai 2010 um 20:20

    Hallo

    Ich habe ein Skritp geschrieben in welchem u.a. auch eine E-Mail versandt wird und zwar mit folgender Zeile

    $Body = "This is a test"
    $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl)

    Die Parameter wurden vorher alle richtig definiert. Am Anfang des Skripts habe ich auch #include "C:\Programmieren\AutoIt\SMTP Mailer.au3".

    Wenn ich das Skript nun mit Run ausführe dann funktioniert alles wunderbar. Wenn ich das Skript aber mit Compile in eine exe umwandle dann funktioniert alles ausser die E-Mail wird nicht verschickt.

    Warum? Muss ich die SMTP Mailer.au3 auch noch compilieren?

  • RunAs mit Parameter

    • Helveticus
    • 17. Mai 2010 um 00:42

    Es scheint doch nicht zu funktionieren. Kann jemand helfen?

  • RunAs mit Parameter

    • Helveticus
    • 16. Mai 2010 um 21:40

    Habs rausgefunden. Einfach "C:\Programme\K10Stat v0.91\K10STAT.exe -loadprofile:1 -nowindow".

  • RunAs mit Parameter

    • Helveticus
    • 16. Mai 2010 um 21:11

    Hallo

    Ich wurde gerne RunAs mit Parameter ausführen, also dem Programm sollen noch Parameter übergeben werden. Konkret ist es folgender Pfad:

    C:\Programme\K10Stat v0.91\K10STAT.exe -loadprofile:1 -nowindow

    Wie geht das?

  • Update

    • Helveticus
    • 13. Mai 2010 um 19:49

    Ich danke dir.

  • Update

    • Helveticus
    • 13. Mai 2010 um 17:47

    Hallo

    Wenn ich eine neue Version von Scite und AutoIt installieren möchte, muss ich dann die alten Versionen deinstallieren oder kann ich die neuen Version einfach drüber installieren?

  • Zeit

    • Helveticus
    • 27. Februar 2010 um 15:34

    Dann halt

    if (@hour > 14) or (@hour = 13 and @min >= 15) then..

  • Zeit

    • Helveticus
    • 27. Februar 2010 um 11:45

    if (@hour > 13) or (@hour = 13 and @min >= 15) then..

    Das ist jetzt also doch falsch?

  • Zeit

    • Helveticus
    • 25. Februar 2010 um 15:50

    Dann muss man jetzt also If @Hour & @min > 1315 then verwenden?

    If @Hour > 13 and @min > 15 wäre für mich logischer.

  • Zeit

    • Helveticus
    • 24. Februar 2010 um 14:19

    Ich meinte ein Programm beenden und nicht das Skript. ;)

    Ich werde es mit WinClose machen.

    Muss ich für @Hour und @Min noch irgendwas includen?

  • Zeit

    • Helveticus
    • 24. Februar 2010 um 12:49

    Habe doch noch eine kleine Frage. Muss ich um @Hour und @Min benutzen zu können etwas includen?

    Und wie kann man ein Programm korrekt beenden? Also ohne controlclick. Starten kann man ja mit Run oder RunAs, aber zum beenden habe ich nichts gefunden ausser den Prozess zu killen, aber das ist ja dann nicht sehr sauber.

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™