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

Beiträge von Xenobiologist

  • Abfrage einer Variable auf 2 bestimmte Formate

    • Xenobiologist
    • 3. September 2008 um 16:51

    Hi,

    such mal nach z.B. _GUICtrlIpAddress_Create

    ich würde StringRegExp dafür empfehlen.

    Mega

    P.S.: DANKE! ;)

  • Datum Konvertieren

    • Xenobiologist
    • 3. September 2008 um 16:49

    Hi,

    das ist eine never-ending story. Das ginge z.B. nicht mehr wenn

    [autoit]

    $date = '01032008' ; YYYY/MM/DD
    ;~ $new = StringRegExpReplace($date, "(\d{2})(\d{2})(\d{4})","$3/$2/$1")
    $new = StringRegExpReplace ($date, "(\d{2}).(\d{2}).(\d{2,4})", "$3/$2/$1")
    MsgBox(0,"",$new)

    [/autoit]

    Mega

  • Abfrage einer Variable auf 2 bestimmte Formate

    • Xenobiologist
    • 3. September 2008 um 14:35

    Hi,

    ist evtl. eine IP Adresse? Da gibt es eigenes Control dafür!

    Mega

  • Inhalt von Ordner löschen

    • Xenobiologist
    • 3. September 2008 um 12:28

    Noch mehr

    Spoiler anzeigen
    [autoit]

    ; Define Source and Destination Directories

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

    $source = "c:\Downloads\Frisur"
    $dest = "c:\Downloads\Frisur\Müll"

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

    ; Obtain Source and Destination Directories' sizes

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

    $ssize = DirGetSize($source)
    $dsize = DirGetSize($dest)

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

    ; Removes "-1" return if the destination directory does not exist

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

    if $dsize < 0 then
    $dsize = 0
    Endif

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

    ; Begins the timer and XCOPY to copy files (will overwrite, remove /y switch to not overwirte)

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

    $tbegin = TimerInit()
    Run(@ComSpec & " /c xcopy /y /e " & $source & "*.* " & $dest, "", @SW_HIDE)

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

    ; Begins Progress Bar and sets it to 0

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

    ProgressOn("Copying Files ...", "", "0 %")
    ProgressSet(0, "Calculating transfer time...")
    sleep(2000); so that erroneous times are not calculated during xcopy startup

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

    For $percent = 0 to 100

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

    $copied = DirGetSize($dest) - $dsize ; calculates how much has been copied
    $percent = Round(($copied/$ssize),2) * 100; percentage copied
    $tdiff = TimerDiff($tbegin) ; time difference since copy began
    $tmin = Round(((100/$percent) -1) * ($tdiff/60000)) ; time (in minutes) to completion
    $tsec = Round(((100/$percent) -1)* ($tdiff/1000)) ; tims (in secs) to completion

    ; If the time remaining is less than 1 minute the progress bar will show time remaining in secs

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

    If $tsec < 60 then
    $tdisplay = "Approximately " & $tsec & " second(s) remaining"
    Else
    $tdisplay = "Approximately " & $tmin & " minute(s) remaining."
    Endif
    ProgressSet( $percent, "Percentage Copied: " & $percent & " %" & @LF _
    & $tdisplay)
    sleep(1000)
    Next
    ProgressSet(100 , "Complete", "")
    sleep(1500)
    ProgressOff()

    [/autoit]
    Spoiler anzeigen
    [autoit]

    ;-------------------------------------------------------------------------------------
    ; Kopiert die Datei c:\Postfach\Benutzer.pst nach \\ntsrv05\pst_archiv\A_Benutzer\
    ; wenn der Benutzer auf die Schaltfläche JA klickt

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

    #include <GUIConstants.au3>

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

    $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") ; Install a custom error handler
    GUICreate("Radio Box Demo", 260, 140)
    GUICtrlCreateLabel("Soll die Datei kopiert werden ?", 20, 20, 250) ; first cell 50 width

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

    ; Create the controls
    $button_1 = GUICtrlCreateButton("Ja", 30, 50, 80, 40)
    $button_2 = GUICtrlCreateButton("Nein", 140, 50, 80, 40)

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

    ; Show the GUI
    GUISetState()

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

    ; Auswahl ausführen.........
    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    Exit
    Case $msg = $button_1
    GUISetState(@SW_HIDE)
    ;MsgBox(0, "Default button clicked", "Ja" )
    ;$username = EnvGet("username")
    copy("c:\Downloads\Systemsoftware_INSTALL\Windows Updates\WindowsXP-KB835935-SP2-DEU.exe" , "c:\WindowsXP-KB835935-SP2-DEU.exe" )
    Case $msg = $button_2
    Exit;MsgBox(0, "Default button clicked", "Nein" )

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

    EndSelect
    WEnd

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

    Func copy($fromFile, $tofile)
    Local $FOF_RESPOND_YES = 16
    Local $FOF_SIMPLEPROGRESS = 256
    $winShell = ObjCreate("shell.application")
    $winShell.namespace ($tofile).CopyHere ($fromFile, $FOF_RESPOND_YES)
    If @error Then MsgBox(0, "", "the previous line got an error.")
    EndFunc ;==>copy

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

    ; This is my custom error handler
    Func MyErrFunc()
    $HexNumber = Hex($oMyError.number, 8)
    MsgBox(0, "", "We intercepted a COM Error !" & @CRLF & _
    "Number is: " & $HexNumber & @CRLF & _
    "Windescription is: " & $oMyError.windescription)
    SetError(1) ; something to check for when this function returns
    EndFunc ;==>MyErrFunc

    [/autoit]

    Mega

  • Inhalt von Ordner löschen

    • Xenobiologist
    • 3. September 2008 um 12:24
    [autoit]

    #include <file.au3>
    #include <date.au3>
    #include <array.au3>

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

    ;Root folder
    $sourceFolder = @ScriptDir & '\'

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

    ;Gather files into an array
    $fileList = _FileListToArray($sourceFolder, "*.txt", 1)
    Dim $found[1]

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

    ;Loop through array
    For $X = 1 To $fileList[0]
    ;Retrieve creation time of file
    $Date = FileGetTime($sourceFolder & "\" & $fileList[$X], 1, 0)
    ;Format date for use with Date UDF
    $fDate = StringFormat("%s/%s/%s %s:%s:%s", $Date[0], $Date[1], $Date[2], $Date[3], $Date[4], $Date[5])
    ;Calculate age, remove files older than one week
    If _DateDiff('d', $fDate, _NowCalc()) > 7 Then ;FileDelete($sourceFolder & "\" & $fileList[$X])
    _ArrayAdd($found, $sourceFolder & $fileList[$X])
    ;MsgBox(1, "Files deleted:", $fileList[$X], 1)
    EndIf
    Next
    _ArrayDisplay($found)

    [/autoit][autoit]

    Local $pattern = "*.*"
    Local $file
    Local $handle

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

    $handle = FileFindFirstFile("c:\Downloads\" & $pattern)
    If $handle = -1 Then
    MsgBox(4096, "Error", "No Files found!")
    Exit
    EndIf

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

    $list=""
    While 1
    $file = FileFindNextFile($handle)
    If @error Then ExitLoop
    If $file <> "." And $file <> ".." Then
    If Not StringInStr(FileGetAttrib($file), "D") Then; not a directory
    $time = FileGetTime($file,0,1)
    $now = @YEAR & @MON & (@MDAY-10) & @HOUR & @MIN & @SEC
    if $time < $now Then
    $list &= $file & @CRLF
    EndIf
    EndIf
    EndIf
    Wend
    FileClose($handle)
    MsgBox(0,"Files older 10 days",$list)

    [/autoit]

    Mega

  • Datum Konvertieren

    • Xenobiologist
    • 3. September 2008 um 11:48

    Hi,

    ;( habe ich nicht verstanden. Ich meinte ja auch nur, ob nun

    010208
    20080102
    020108
    01022008
    usw.

    Man muss halt wissen was kommt

    Mega

  • Datum Konvertieren

    • Xenobiologist
    • 3. September 2008 um 11:16

    @Pee : Das ist klar. Man muss aber schon wissen was einen erwartet, dann kann man darauf reagieren.

    Valik würde sagen, wer Schrott übergibt, der bekommt auch Schrott zurück.

    Woran willst du diesen Unterschied YYYY/MM/DD und YYYY/DD/MM festmachen wenn es der 2008 01 01 ist? Das MUSST du wissen, oder sicher ermittlen können.

    Mega

  • Datum Konvertieren

    • Xenobiologist
    • 3. September 2008 um 11:02

    Hi,

    wieso soll das nicht reichen? Du musst ja zumindest wissen YYYY irgendwas MM irgendwas DD

    Spoiler anzeigen
    [autoit]

    $date = '01032008' ; YYYY/MM/DD
    $new = StringRegExpReplace($date, "(\d{2})(\d{2})(\d{4})","$3/$2/$1")
    MsgBox(0,"",$new)

    [/autoit]

    Mega

  • Soundvolume bekommen - mciSendString

    • Xenobiologist
    • 3. September 2008 um 10:56

    Hi,

    wozu das Rad neu erfinden. Es gibt bereits Audio und Sound.au3 UDFs

    Einfach mal suchen.

    Mega

  • Wie erkenne ich mit AutoIT ein Icon im SystemTray?

    • Xenobiologist
    • 3. September 2008 um 10:55

    Hi,

    du brauchst doch nur die exe(den Prozess) nehmen. Deine exe wird doch nur ein TrayIcon haben, oder nicht?

    Mega

  • Datum Konvertieren

    • Xenobiologist
    • 3. September 2008 um 08:42
    [autoit]

    $date = '01.03.2008' ; YYYY/MM/DD
    $new = StringRegExpReplace($date, "(\d{2})\.(\d{2})\.(\d{4})","$3/$2/$1")
    MsgBox(0,"",$new)

    [/autoit]

    Mega

  • Parameter übergeben?

    • Xenobiologist
    • 2. September 2008 um 20:17

    Hi,

    du meinst $cmdLine ?

    Mega

  • Chat mit Server

    • Xenobiologist
    • 2. September 2008 um 18:16

    Dann weißt du aber nicht ob sie angekommen ist :D

  • Chat mit Server

    • Xenobiologist
    • 2. September 2008 um 17:19

    Solange der User das will ja. Ansonsten schließe ich einfach das Fenster oder schieße den Prozess ab. Kommt halt drauf an, wie wichtig es ist.

    Könnte z.B. den Netzwerkstecker(LAN) ziehen dann OK klicken. was dann?

    usw.

    :D

    Mega

  • Chat mit Server

    • Xenobiologist
    • 2. September 2008 um 16:18

    :D wie willst du denn überprüfen, ob es jemand gelesen hat. Du kannst eine Rückmeldung geben ist angekommen, okay.

    Mega

  • Chat mit Server

    • Xenobiologist
    • 2. September 2008 um 15:52

    Hi,

    du meinst ein lokales IM. Sowas wie Sametime oder ICQ im LAN?

    Mega

  • FileCopy

    • Xenobiologist
    • 2. September 2008 um 14:51

    Hi,

    dann kannst du

    a) den relativen
    b) den absoluten Pfad
    nutzen

    Mega

  • "_WinAPI...."-Fehler beim Benutzen von _GUICtrlComboBoxEx_-Funktionen

    • Xenobiologist
    • 2. September 2008 um 13:11

    Hi,

    kompilier es mal als exe und teste dann. Wenn es nicht geht, dann schick mir die exe

    Mega

  • Fehler ausgeben

    • Xenobiologist
    • 2. September 2008 um 11:04

    Hi,

    zeig mal dein Script. In Scite kannst du Trace Lines einfügen lassen.

    Mega

  • Fehler ausgeben

    • Xenobiologist
    • 2. September 2008 um 09:52

    Hi,

    habe dein Problem noch nicht verstanden.

    Protokollieren kannst mit z.B. _FileWriteLog

    Dienste überprüfen oder Prozesse kontrollieren ist ebenfalls kein Problem.

    Mega

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™