Vielen Dank,
es hat so funktioniert.
Vielen Dank,
es hat so funktioniert.
Hallo alle zusammen,
ich hab dieses Skript:
Global $oMyRet[2] Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") ;#include <_pop3.au3> #include <_INetSmtpMailCom.au3> ;################################## ; Variables ;################################## $SmtpServer = "smtp.web.de" ; address for the smtp-server to use - REQUIRED $FromName = "" ; name from who the email was sent $FromAddress = "myName@web.de" ; address from where the mail should come $ToAddress = "taAdress@gmx.de" ; destination address of the email - REQUIRED $Subject = "Userinfo" ; subject from the email - can be anything you want it to be $Body = "Test" ; 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 = "myName@web.de" ; username for the account used from where the mail gets sent - REQUIRED $Password = "PassWort" ; password for the account used from where the mail gets sent - REQUIRED $IPPort = 587 ; port used for sending the mail normaly 25 $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 ;################################## ;_pop3Connect("pop3.live.com", $Username, $Password) $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl) If @error Then MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc) EndIf
[/autoit]
von AutoBert aus diesem Thread: KLICK
Jetzt ist meine Frage wie ich das somachen kann das man auswählen kann ob man AttachFiles hat oder nicht.
Ich hab eine GUI, wo eine Checkbox ist, wo man wählen kann ob man eine Datei anhängen möchte. Immer wenn ich dann die Checkbox unaktivert lasse, kommt ein Fehler das die Variable die ich dem OpenFileDialog zugewiesen habe, nicht deklariert ist.
Hier mal die Funktion dazu:
If (GUICtrlRead($Screenshot)) = $GUI_CHECKED Then
$message = "Bitte wählen Sie den Screeshot."
$var = FileOpenDialog($message, "C:\", "Bilder (*.jpg;*.bmp)", 1 + 4 )
If @error Then
MsgBox(0, "Fehler!", "Es ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.")
$var = ""
Exit
Else
$var = StringReplace($var, "|", @CRLF)
EndIf
Else
MsgBox(64, "Nicht aktiviert", "Test")
EndIf
;##################################
; Variables
;##################################
$Antwort = GUICtrlRead($Auswahl_System)
$Name_Abteilung = GUICtrlRead($Abteilung)
$SmtpServer = "smtp.web.de" ; address for the smtp-server to use - REQUIRED
$FromName = @UserName ; name from who the email was sent
$FromAddress = "xxx" ; address from where the mail should come
$ToAddress = "xxx" ; destination address of the email - REQUIRED
$Subject = "Supportmeldung: " & @ComputerName ; subject from the email - can be anything you want it to be
$Body = "Datum: " & @MDAY & "." & @MON & "." & @YEAR & @CRLF & "Uhrzeit: " & @HOUR & ":" & @MIN & @CRLF & "Benutzername: " & @UserName & @CRLF & "Computername: "& @ComputerName & @CRLF & "IP Addresse: " & @IPAddress1 & @CRLF & "System: "& $Antwort & @CRLF & "Fehlerbeschreibung: " & GUICtrlRead($Fehlerbescheibung)
; the messagebody from the mail - can be left blank but then you get a blank mail
$AttachFiles = $var ; 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" ; 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 = 587 ; port used for sending the mail normaly 25
$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
;##################################
$rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl)
If @error Then
MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc)
Else
MsgBox(64, "Erfolgreich", "Die Supportmitteilung wurde erfolgreich an die Fachinformatik übermittelt. Bitte haben Sie gedult, wir setzten und sofort mit Ihnen in Verbindung.")
EndIf
Ich hoffe ihr wisst was ich meine und könnt mir helfen.
Lg und danke
Ich habs rausgefunden, warum es nicht ging.
Es fehlte nur ein include.
Das mit dem Befehl habe ich jetzt hinbekommen, nur bei diesem StdoutRead und bei StderrRead komme ich nicht weiter.
Das ist mein Code bis jetzt. Ich weiß echt nicht weiter.
Func Finde_IPs()
Local $Cmd = Run(@ComSpec & " /c " & 'net view /all', "", @SW_MINIMIZE, $STDERR_CHILD, $STDIN_CHILD & $STDOUT_CHILD)
Local $Cmd_IP
While 1
$Cmd_IP = StdoutRead($Cmd)
If @error Then
ExitLoop
MsgBox(64, "Es ist ein Fehler aufgetreten.", $Cmd_IP)
EndIf
IniWrite("test.ini", "Name", "IP", $Cmd_IP)
WEnd
While 1
$Cmd_IP = StderrRead($Cmd)
If @error Then
ExitLoop
MsgBox(64, "Es ist ein Fehler aufgetreten.", $Cmd_IP)
EndIf
WEnd
EndFunc
Ich bekomme bei den zwei Befehlen StdoutRead() und bei StderrRead() immer einen Fehler angezeigt.
[autoit]C:\Users\praktikant\Desktop\AutoIT\Netzwerk-Scanner\scanner.au3(52,49) : WARNING: $STDOUT_CHILD: possibly used before declaration.
Run("cmd /c net view","",@SW_HIDE,$STDOUT_CHILD+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\praktikant\Desktop\AutoIT\Netzwerk-Scanner\scanner.au3(52,63) : WARNING: $STDERR_CHILD: possibly used before declaration.
Run("cmd /c net view","",@SW_HIDE,$STDOUT_CHILD+$STDERR_CHILD)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\praktikant\Desktop\AutoIT\Netzwerk-Scanner\scanner.au3(53,12) : ERROR: StdoutRead() [built-in] called with wrong number of args.
StdoutRead()
~~~~~~~~~~~^
C:\Users\praktikant\Desktop\AutoIT\Netzwerk-Scanner\scanner.au3(54,12) : ERROR: StderrRead() [built-in] called with wrong number of args.
StderrRead()
~~~~~~~~~~~^
C:\Users\praktikant\Desktop\AutoIT\Netzwerk-Scanner\scanner.au3(55,13) : ERROR: TCPNameToIP() [built-in] called with wrong number of args.
TCPNameToIP()
Ok mache ich.
Danke
Guten Morgen.
Ist es mit AutoIT möglich alle IP-Adressen eines Netzwerks anzuzeigen?
Und wenn ja, wie mache ich das am besten?
LG und danke
Ich hab jetzt mal bei einem 32-Bit Windows System nachgeguckt und da ist in der Registry bei Uninstal kein Eintrag für Adobe Reader.
Gibt es noch eine andere Möglichkeit herauszufinden was installiert ist?
Kann AutoIT auch auf Programme und Funktionen in der Systemsteuerung zugreifen?
Ok, danke für den Tipp.
Nur habe ich jetzt das Problem, das zum Beispiel der Adobe Reader nicht darin angezeigtwird obwohl er installiert ist.
Das hatte ich mir auch schon überlegt.
Ich habs jetzt so gemacht das er im Standartinstallatiospfad sucht, aber was mache ich wenn das jemand vorher in ein anderes Verzeichniss installiert hat?
Sorry für die Fragen, kenne mich in AutoIT noch nicht so gut aus.
Weil ich für so Standart Programme ein Tool erstellen wollte, welche die Programme automatisch installiert.
Ich hätte nur vorher gerne eine Abfrage ob das Programm schon auf dem Rechner vorhanden ist.
Hallo alle zusammen.
Wie kann ich mit AutoIT überprüfen ob ein bestimmtes Programm schon auf dem Rechner installiert ist?
LG und danke
Hallo.
In der cmd gibt es ja bei dem Befehl Ping den Parameter -a, um die IP-Adresse in Hostnamen aufzulösen.
Was mich interesieren würde, ob es diese Möglichkeit auch im AutoIT gibt.
Ich hoffe ihr wisst was ich meine.
LG und danke
Hallo.
#include
#include
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Status", 345, 89, 193, 125)
$Progress1 = GUICtrlCreateProgress(8, 64, 326, 17)
GUICtrlSetLimit(-1, 4590, 0)
$Label1 = GUICtrlCreateLabel("Bitte Warten - Die IP-Adressen werde überprüft", 8, 40, 327, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("Starten!", 8, 8, 331, 25, 0)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
; Benötigte Textdateien erstellen
If Not _FileCreate("erfolgreich.txt") Then
EndIf
If Not _FileCreate("fehlgeschlagen.txt") Then
EndIf
$erfolgreich = FileOpen("erfolgreich.txt", 2)
$fehlgeschlagen = FileOpen("fehlgeschlagen.txt", 2)
For $bereich = 1 To 18
For $adresse = 1 To 255
If Ping("xx.xxx."&$bereich&"."&$adresse,2) Then
FileWriteLine($erfolgreich, "Online: xx.xxx."&$bereich&"."&$adresse&@CRLF)
Else
FileWriteLine($fehlgeschlagen, "Offline: xx.xxx."&$bereich&"."&$adresse&@CRLF)
EndIf
GUICtrlSetData($Progress1, 1)
Next
Next
MsgBox(0, "Erfolgreich!", "Es wurden alle IPs erfolgreich überprüft!")
ExitLoop
EndSwitch
WEnd
Das ist mein Skript, mit welchem ich alle IP-Adressen in unserer Firma anpingen lasse.
NAch der 2. For-Schleife soll sich die Progressbar um 1 erhöhen, wie mache ich das?
Im Moment erhöht sich der Wert nur einmal.
LG und Danke