• The Stick soll meine Batch-Datei auf dem USB-Stick ersetzen und diesen bei Bedarf auf die Festplatte nach Eigene Dateien\Eigene Sticks sichern. Es ist ein kleines Script und benötigt ca. 1MB Speicherplatz auf dem USB-Stick. Als Packer kommt das Kommandozeilenprogramm "7zA.exe" (Standalone-Vers. von 7Zip) zur Anwendung. Das Open-Source Programm ist im normalen Download nicht enthalten. 7Za wird hier mitgeliefert und kann dem Download entnommen werden. Bei der Sicherung handelt es sich um ein "SystemBackup". Nach 7 Sicherungen, wird die Erste überschrieben die Festplatte wird nicht so schnell voll und die Daten bleiben aktuell.

    Sprache: Deutsch
    Betriebssysteme: Windows XP, 2003, Vista, Seven
    Version: USBv3800_2010-08-11.zip
    Dateigröße: 732 K

    TheStick
    [autoit]


    #region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_icon=USBsys\compile.ico
    #AutoIt3Wrapper_outfile=USBv3.8.exe
    #AutoIt3Wrapper_Res_Description=The Stick
    #AutoIt3Wrapper_Res_Fileversion=3.8.0.0
    #AutoIt3Wrapper_Res_LegalCopyright=© 2010 by Ritzelrocker04
    #AutoIt3Wrapper_Res_Language=1031
    #AutoIt3Wrapper_Res_Field=Compiled by|Ritzelrocker04
    #AutoIt3Wrapper_Res_Field=AutoIt Version|%AutoItVer%
    #AutoIt3Wrapper_Res_Field=Original Name|USBv3.8.exe
    #AutoIt3Wrapper_Run_Tidy=y
    #AutoIt3Wrapper_Run_Obfuscator=y
    #endregion ;**** Directives created by AutoIt3Wrapper_GUI ****

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

    #region ### include section ###
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #endregion ### include section ###

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

    #region ### variablen section ###
    $src_LW = StringLeft(@ScriptDir, 3); Quelle - The Stick
    $dest_LW = StringLeft(@MyDocumentsDir, 2); Ziel - Eigene Dateien

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

    Dim $VOL_Ziel[2], $VOL_Quelle[4]

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

    $title = "The Stick v 3.8"
    $build = " Build 2010-08-11 "
    $uccess = "USBsound\Success.wav"
    #endregion ### variablen section ###

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

    #region ### START The Stick - GUI section ###
    $GUI = GUICreate($title, 300, 147, -1, -1, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
    GUICtrlCreatePic("USBskin\Yellow3.jpg", 0, 16, 300, 115, 0)
    $bn_Up = GUICtrlCreateButton(" J J J J J J J J ", 0, 0, 300, 16)
    GUICtrlSetFont(-1, 10, 400, 0, "Wingdings")
    $gb_Ziel = GUICtrlCreateGroup("", 66, 24, 224, 70) ; create group $gb_Ziel
    $tb_Ziel = GUICtrlCreateInput("", 78, 41, 200, 17, BitOR($ES_CENTER, $ES_AUTOHSCROLL, $ES_READONLY))
    GUICtrlSetBkColor(-1, 0xFFFBF0)
    $ctrlProgBkgrnd1 = GUICtrlCreateLabel("", 78, 67, 200, 15, BitOR($ES_AUTOHSCROLL, $ES_READONLY))
    GUICtrlSetBkColor(-1, 0x00FF00) ; green background
    $ctrlProgress1 = GUICtrlCreateLabel("", 78, 67, 1, 15, BitOR($ES_AUTOHSCROLL, $ES_READONLY))
    GUICtrlSetBkColor(-1, 0xFF0000) ; Red progress bar
    GUICtrlCreateGroup("", -99, -99, 1, 1) ; close group $gb_Ziel
    $bn_Pic = GUICtrlCreateButton("PicBn", 10, 30, 55, 64, $BS_BITMAP)
    GUICtrlSetImage(-1, "USBsys\img.bmp")
    $bn_Sichern = GUICtrlCreateButton("&Sichern", 133, 101, 75, 22, 0)
    GUICtrlSetState(-1, $GUI_DEFBUTTON)
    $bn_Close = GUICtrlCreateButton("&Beenden", 213, 101, 75, 22, 0)
    $bn_Autor = GUICtrlCreateButton("RR04", 10, 111, 34, 16)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetTip(-1, "UpdateCheck")
    $bn_Down = GUICtrlCreateButton(" J J J J J J J J ", 0, 131, 300, 16)
    GUICtrlSetFont(-1, 10, 400, 0, "Wingdings")
    #endregion ### START The Stick - GUI section ###

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

    #region ### The Stick - GUI section ###
    $GuiStick = GUICreate($title, 300, 115, -1, -1, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
    GUICtrlCreatePic("USBskin\Dialo.jpg", 0, 0, 300, 115, 0)
    $tb_src_Total = GUICtrlCreateInput("", 8, 20, 140, 17, $ES_READONLY)
    GUICtrlSetBkColor(-1, 0xFFFBF0)
    $tb_src_Free = GUICtrlCreateInput("", 152, 20, 140, 17, $ES_READONLY)
    GUICtrlSetBkColor(-1, 0xFFFBF0)
    $tb_src_Belegt = GUICtrlCreateInput("", 8, 70, 140, 17, $ES_READONLY)
    GUICtrlSetBkColor(-1, 0xFFFBF0)
    $tb_src_Prozent = GUICtrlCreateInput("", 152, 70, 68, 17, $ES_READONLY)
    GUICtrlSetBkColor(-1, 0xFFFBF0)
    $ctrlProgBkgrnd2 = GUICtrlCreateLabel("", 8, 45, 284, 15, BitOR($ES_AUTOHSCROLL, $ES_READONLY))
    GUICtrlSetBkColor(-1, 0x00FF00) ; green background
    $ctrlProgress2 = GUICtrlCreateLabel("", 8, 45, 1, 15, BitOR($ES_AUTOHSCROLL, $ES_READONLY))
    GUICtrlSetBkColor(-1, 0xFF0000) ; Red progress bar
    $bn_Return = GUICtrlCreateButton("zurück", 225, 85, 65, 22, 0)

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

    GUISetState(@SW_SHOW, $GUI)
    GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST") ;i Funktion zum verschieben der Oberfläche
    #endregion ### The Stick - GUI section ###

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

    ; starten Func _infoLW()
    _infoLW()

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

    While 1
    $msg = GUIGetMsg(1)
    Switch $msg[1] ; window-handle
    Case $GUI
    Switch $msg[0] ; event/control-handle
    Case $bn_Pic
    GUISetState(@SW_HIDE, $GUI)
    GUISetState(@SW_SHOW, $GuiStick)
    Case $bn_Close
    Exit
    Case $bn_Autor
    ShellExecute("http://ritzelrocker04.bplaced.net/thema1.htm")
    Case $bn_Up
    _About() ; starten Func _About()
    Case $bn_Down
    _About() ; starten Func _About()
    Case $bn_Sichern
    If FileExists(@MyDocumentsDir & '\Eigene USB-Sticks\USB-Stick-0' & @WDAY & '.zip') Then
    $ExistsFileWahl = MsgBox(262144 + 48 + 4, " Löschen", "Die Datei " & 'USB-Stick-0' & @WDAY & '.zip besteht bereits. ' & @CRLF & ' Möchten Sie sie ersetzen ? ')
    If $ExistsFileWahl = 6 Then
    FileDelete(@MyDocumentsDir & '\Eigene USB-Sticks\USB-Stick-0' & @WDAY & '.zip')
    EndIf
    EndIf
    $_Userwahlsich = MsgBox(262144 + 32 + 4, " Sichern", $VOL_Ziel[2] & " MB frei " & @CRLF & $VOL_Quelle[4] & " MB ca. nötig " & @CRLF & "Die Daten werden in komprimierter Form abgespeichert." & @CRLF & "Dass kann, je nach Datenmenge des USB-Sticks, einige Minuten dauern." & @CRLF & "Bitte warten Sie die Erfolgsmeldungen ab !" & @CRLF & @CRLF & "Möchten Sie fortfahren ? ")
    If $_Userwahlsich = 7 Then
    MsgBox(262144 + 48, " Sichern", " ...es wurden keine Daten gesichert ! ")
    Exit
    EndIf
    RunWait('USBsys\7za.exe a -tzip "' & @MyDocumentsDir & '\Eigene USB-Sticks\USB-Stick-0"' & @WDAY & '".zip" "' & $src_LW, @MyDocumentsDir, @SW_HIDE)
    _infoLW() ; starten Func _infoLW()
    _Log_Write() ; starten Func _Log_Write()
    ;SoundSetWaveVolume(50) ; optional (50)Lautstärke in %
    SoundPlay($uccess, 1) ; 1 = Skript wartet, bis der Sound abgespielt ist.
    MsgBox(262144 + 64, " Sicherung fertig", "Sicherung vom " & @CRLF & @CRLF & @MDAY & "-" & @MON & "-" & @YEAR & " um " & @HOUR & ":" & @MIN & " Uhr " & @CRLF & @CRLF & "ist abgeschlossen ! ")
    Exit
    EndSwitch
    Case $GuiStick
    Switch $msg[0]
    Case $bn_Return
    GUISetState(@SW_SHOW, $GUI)
    GUISetState(@SW_HIDE, $GuiStick)
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_SHOW, $GUI)
    GUISetState(@SW_HIDE, $GuiStick)
    EndSwitch
    EndSwitch
    WEnd

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

    ; die Funktion _infoLW()
    Func _infoLW()
    ; Quelle
    $VOL_Quelle = _drive($src_LW)
    $iProg2 = ($VOL_Quelle[0] / 100) * 284
    GUICtrlSetPos($ctrlProgress2, 8, 45, $iProg2, 15)
    GUICtrlSetData($tb_src_Prozent, "Free: " & 100 - $VOL_Quelle[0] & "%")
    GUICtrlSetData($tb_src_Total, "Total: " & $VOL_Quelle[3] & " MB")
    GUICtrlSetData($tb_src_Free, "Free: " & $VOL_Quelle[2] & " MB")
    GUICtrlSetData($tb_src_Belegt, "Full: " & $VOL_Quelle[4] & " MB")
    ; Ziel
    $VOL_Ziel = _drive($dest_LW)
    $iProg1 = ($VOL_Ziel[0] / 100) * 200
    GUICtrlSetPos($ctrlProgress1, 78, 67, $iProg1, 15)
    GUICtrlSetData($tb_Ziel, "(" & $VOL_Ziel[1] & ")" & " = " & $VOL_Ziel[2] & " MB = " & 100 - $VOL_Ziel[0] & "% free ")
    EndFunc ;==>_infoLW

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

    ; die Funktion _drive()
    Func _drive($LW)
    Local $aDrive[5]
    $aDrive[1] = $LW
    $TOTAL = DriveSpaceTotal($LW)
    $FREE = DriveSpaceFree($LW)
    $aDrive[2] = _StringAddThousandsSep(StringReplace(Round($FREE, 0), '.', ','), ".", ",")
    $aDrive[0] = _StringAddThousandsSep(StringReplace(Round(($TOTAL - $FREE) / ($TOTAL / 100), 0), ".", ","), ".", ",")
    $aDrive[3] = _StringAddThousandsSep(StringReplace(Round($TOTAL, 0), '.', ','), ".", ",")
    $aDrive[4] = _StringAddThousandsSep(StringReplace(Round($TOTAL - $FREE, 0), '.', ','), ".", ",")
    ; ^ genauer als $VOL_Quelle[3] - $VOL_Quelle[2]
    Return $aDrive
    EndFunc ;==>_drive

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

    ; die Funktion _Log_Write()
    Func _Log_Write()
    $logfile = FileOpen("TheStick.log", 2) ;2 = Schreibmodus mit Löschen des vorherigen Inhaltes
    If $logfile = -1 Then
    MsgBox(262144 + 48, "Error", " Die Datei " & @ScriptDir & "/TheStick.log" & @CRLF & " konnte nicht gefunden werden.", 9)
    ;Exit
    EndIf
    FileWriteLine($logfile, @MDAY & "." & @MON & "." & @YEAR & " um " & @HOUR & ":" & @MIN & ":" & @SEC & " Uhr ")
    FileClose($logfile)
    EndFunc ;==>_Log_Write

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

    ; die Funktion _About()
    Func _About()
    $logfile = FileOpen("TheStick.log", 0) ; 0 = nur Lesemodus (read mode)
    If $logfile = -1 Then
    MsgBox(262144 + 48, "Error", " Die Datei " & @ScriptDir & "TheStick.log" & @CRLF & " konnte nicht gefunden werden. Diese Datei wird erstmals nach der ersten Sicherung erstellt ! ")
    Exit
    EndIf
    $line = FileReadLine($logfile)
    MsgBox(262144 + 64, 'About', $title & $build & @CRLF & '' & @CRLF & 'Copyright: 2010 by Ritzelrocker04 ' & @CRLF & 'Thx an das http://www.Autoit.de - Team ' & @CRLF & '' & @CRLF & 'Die letzte Sicherung war am : ' & @CRLF & $line)
    FileClose($logfile)
    EndFunc ;==>_About

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

    Func _StringAddThousandsSep($SSTRING, $STHOUSANDS = ",", $SDECIMAL = ".")
    Local $SRESULT = ""
    Local $ANUMBER = StringRegExp($SSTRING, "(\d+)\D?(\d*)", 1)
    If UBound($ANUMBER) = 2 Then
    Local $SLEFT = $ANUMBER[0]
    While StringLen($SLEFT)
    $SRESULT = $STHOUSANDS & StringRight($SLEFT, 3) & $SRESULT
    $SLEFT = StringTrimRight($SLEFT, 3)
    WEnd
    $SRESULT = StringTrimLeft($SRESULT, 1)
    If $ANUMBER[1] <> "" Then $SRESULT &= $SDECIMAL & $ANUMBER[1]
    EndIf
    Return $SRESULT
    EndFunc ;ehemals aus AutoIt ==>_StringAddThousandsSep

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

    Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam)
    If ($hWnd = $GUI) And ($iMsg = $WM_NCHITTEST) Or ($hWnd = $GuiStick) And ($iMsg = $WM_NCHITTEST) Then Return $HTCAPTION
    EndFunc ;==>WM_NCHITTEST
    ; Ende

    [/autoit]


    Den kompletten Download findet Ihr auf meiner AutoIt-Skriptsammlung! :thumbup:
    Viel Spaß mit "The Stick" !

    Die aktuelle Version hier:

  • Hi,

    wer Ordnung liebt ist zu faul zum suchen, nach Laufwerksbuchstaben des USB-Stick. Die obigen Scripte sind sehr personalisiert. Das ist manchmal ein Vor- oder Nachteil. Das hier erkennbare Interesse zu diesem Thema hat mich eine praktikable Lösung für Alle suchen lassen. Diese möchte ich hier vorstellen. Die Daten des USB-Sticks werden in die Eigenen Dateien\My Stick des jeweiligen Nutzers gepackt. Stick und Eigene Dateien werden natürlich automatisch erkannt. ;):rolleyes:

    Ein neuer Skin im Vista Styl ist auch dabei.

    Spoiler anzeigen
    [autoit]


    ; by Ritzelrocker04 ==> USBv22_02.au3

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

    #include <GUIConstants.au3>
    #include <String.au3>

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

    ; Ziel
    Global $dest_LW = StringLeft(@MyDocumentsDir,2)
    ; Quelle
    Global $src_LW = StringLeft(@ScriptDir,2) & "\"

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

    $uccess = "USBsound\Success.wav"

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

    $GUI = GUICreate(" USB v 2.2", 300, 115, -1, 225, $WS_POPUPWINDOW)
    GUICtrlCreatePic("USBskin\Blau43.jpg", 0, 0, 300, 115)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $gb_Ziel = GUICtrlCreateGroup("", 64, 8, 225, 60)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $pg_Ziel = GUICtrlCreateProgress(75, 32, 195, 17)
    $bn_Pic = GUICtrlCreateButton("PicButton", 8, 14, 55, 55, $BS_BITMAP)
    GUICtrlSetImage (-1, "USBsys\images3.bmp", 22)
    $bn_Sichern = GUICtrlCreateButton("&Sichern", 126, 80, 75, 25, 0)
    GUICtrlSetState(-1, $GUI_DEFBUTTON)
    $bn_Close = GUICtrlCreateButton("&Beenden", 212, 80, 75, 25, 0)
    $bn_Autor = GUICtrlCreateButton("RR04", 2, 96, 30, 17)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetColor(-1, 0x808080)

    ; Quelle - The Stick - GUI
    $GUI_Stick = GUICreate(" The Stick", 300, 115, -1, 225, $WS_POPUPWINDOW)
    GUICtrlCreatePic("USBskin\Blau43.jpg", 0, 0, 300, 115)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $tb_src_Total = GUICtrlCreateInput("", 8, 20, 140, 17, $ES_READONLY)
    $tb_src_Free = GUICtrlCreateInput("", 152, 20, 140, 17, $ES_READONLY)
    $tb_src_Belegt = GUICtrlCreateInput("", 8, 70, 140, 17, $ES_READONLY)
    $tb_src_Prozent = GUICtrlCreateInput("", 152, 70, 57, 17, $ES_READONLY)
    $pg_Quelle = GUICtrlCreateProgress(8, 45, 284, 17)
    $bn_Return = GUICtrlCreateButton("zurück", 212, 80, 75, 25, 0)

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

    GUISetState(@SW_SHOW, $GUI)

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

    ; starten Func _LW_info()
    _LW_info()

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

    While 1
    $msg = GUIGetMsg(1)
    Switch $msg[1] ; window-handle
    Case $GUI
    Switch $msg[0] ; event/control-handle
    Case $bn_Pic
    GUISetState(@SW_HIDE, $GUI)
    GUISetState(@SW_SHOW, $GUI_Stick)
    Case $GUI_EVENT_CLOSE
    Exit
    Case $bn_Close
    Exit
    Case $bn_Autor
    MsgBox(64, 'About', 'The Stick v 2.2.02 Build 2008-01-03/12 ' & @CRLF & '' & @CRLF & 'Copyright by : ' & @CRLF & '' & @CRLF & 'Ritzelrocker04 ' & @CRLF & '' & @CRLF & 'Thx an das http://www.Autoit.de - Team ')
    Case $bn_Sichern
    $_Userwahlsich = MsgBox(32+4, " Sichern", "Sichern, möchten Sie fortfahren ? ")
    If $_Userwahlsich = 7 Then
    MsgBox(48, " Sichern", " ...es wurden keine Daten gesichert ! ")
    Exit
    EndIf

    RunWait('USBsys\7za.exe a -tzip "' & @MyDocumentsDir & '\My Stick\USB-Stick-0"' & @WDAY & '".zip" "' & $src_LW, @MyDocumentsDir, @SW_MINIMIZE)
    _LW_info() ; starten Func _LW_info()
    SoundSetWaveVolume(50) ;(50)Lautstärke in %
    SoundPlay($uccess, 1) ; 1 = Skript wartet, bis der Sound abgespielt ist.
    MsgBox(64, " Sicherung", " Sicherung abgeschlossen ! ")
    Exit
    EndSwitch
    Case $GUI_Stick
    Switch $msg[0]
    Case $bn_Return
    GUISetState(@SW_SHOW, $GUI)
    GUISetState(@SW_HIDE, $GUI_Stick)
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_SHOW, $GUI)
    GUISetState(@SW_HIDE, $GUI_Stick)
    EndSwitch
    EndSwitch
    WEnd

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

    ; die Funktion _LW_info()
    Func _LW_info()

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

    ; Quelle
    $VOL_Quelle = DriveGetLabel($src_LW)
    $TOTAL_Quelle = DriveSpaceTotal($src_LW)
    $FREE_Quelle = DriveSpaceFree($src_LW)
    $FREE_Quelle_Prozent = StringReplace(Round(($FREE_Quelle) / ($TOTAL_Quelle / 100), 0), ".", ",")
    $FREE_Quelle_MB = _StringAddComma(StringReplace(Round ($FREE_Quelle, 2), '.', ','), ".", ",")
    $Belegt_Quelle_MB = _StringAddComma(StringReplace(Round ($TOTAL_Quelle - $FREE_Quelle, 2), '.', ','), ".", ",")
    $TOTAL_Quelle_MB = _StringAddComma(StringReplace(Round ($TOTAL_Quelle, 2), '.', ','), ".", ",")
    $i_Progress_Quelle = StringReplace(Round(($TOTAL_Quelle - $FREE_Quelle) / ($TOTAL_Quelle / 100), 2), ".", ",")

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

    ; Ziel
    $VOL_Ziel = DriveGetLabel($dest_LW)
    $TOTAL_Ziel = DriveSpaceTotal($dest_LW)
    $FREE_Ziel = DriveSpaceFree($dest_LW)
    $FREE_Ziel_Prozent = StringReplace(Round(($FREE_Ziel) / ($TOTAL_Ziel / 100), 0), ".", ",")
    $FREE_Ziel_MB = _StringAddComma(StringReplace(Round ($FREE_Ziel, 2), '.', ','), ".", ",")
    $i_Progress_Ziel = StringReplace(Round(($TOTAL_Ziel - $FREE_Ziel) / ($TOTAL_Ziel / 100), 2), ".", ",")

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

    ; letzte Berechnungen und setzen der Ergebnisse
    ; Ziel
    GUICtrlSetData($pg_Ziel, $i_Progress_Ziel)
    GUICtrlSetData($gb_Ziel, "( " & $dest_LW & " )" & " = " & $FREE_Ziel_MB & " MB = " & $FREE_Ziel_Prozent & " % frei ")
    ; Quelle
    GUICtrlSetData($tb_src_Total, "Gesamt: " & $TOTAL_Quelle_MB & " MB")
    GUICtrlSetData($tb_src_Free, "Frei: " & $FREE_Quelle_MB & " MB")
    GUICtrlSetData($pg_Quelle, $i_Progress_Quelle)
    GUICtrlSetData($tb_src_Belegt, "Belegt: " & $Belegt_Quelle_MB & " MB")
    GUICtrlSetData($tb_src_Prozent, "Frei: " & $FREE_Quelle_Prozent & " %")

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

    EndFunc ; ==> _LW_info()

    [/autoit]

    Schönes WE und weiterhin
    viel Spaß !

    Man liest sich...
    Euer Ritzelrocker04

  • Guter Tipp. Ich verwendete bisher AutorunnerX. Das ist zwar sicherer, aber nicht so komfortabel.
    Aber es gibt nochmal was besseres! USBDLM

  • Der Nachbar klingelt, ich kann helfen und bin ca. eine Stunde lang beschäftigt. Nun zurück blicke ich auf meinen Stick und frage mich: „Habe, wollte oder war ich gerade dabei ihn zu sichern ?“

    Kein Problem :!:

    Ein Klick auf den kleinen Button zeigt die Antwort :!::rolleyes:
    PS: Zeile 73 ist ein Dummy

    Spoiler anzeigen
    [autoit]


    ; by Ritzelrocker04 ==> USBv2203.au3

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

    #include <GUIConstants.au3>
    #include <String.au3>

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

    ; Ziel
    Global $dest_LW = StringLeft(@MyDocumentsDir,2)
    ; Quelle
    Global $src_LW = StringLeft(@ScriptDir,2) & "\"

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

    $uccess = "USBsound\Success.wav"

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

    ; - Start - GUI
    $GUI = GUICreate(" USB v 2.2", 300, 115, -1, 190, $WS_POPUPWINDOW)
    GUICtrlCreatePic("USBskin\Blau43.jpg", 0, 0, 300, 115)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $gb_Ziel = GUICtrlCreateGroup("", 64, 8, 225, 60)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $pg_Ziel = GUICtrlCreateProgress(75, 32, 195, 17)
    $bn_Pic = GUICtrlCreateButton("PicButton", 8, 14, 55, 55, $BS_BITMAP)
    GUICtrlSetImage (-1, "USBsys\images3.bmp", 22)
    $bn_Sichern = GUICtrlCreateButton("&Sichern", 126, 80, 75, 25, 0)
    GUICtrlSetState(-1, $GUI_DEFBUTTON)
    $bn_Close = GUICtrlCreateButton("&Beenden", 212, 80, 75, 25, 0)
    $bn_Autor = GUICtrlCreateButton("RR04", 2, 96, 30, 17)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetColor(-1, 0x808080)

    ; - The Stick - GUI
    $GUI_Stick = GUICreate(" The Stick", 300, 115, -1, 190, $WS_POPUPWINDOW)
    GUICtrlCreatePic("USBskin\Blau43.jpg", 0, 0, 300, 115)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $tb_src_Total = GUICtrlCreateInput("", 8, 20, 140, 17, $ES_READONLY)
    $tb_src_Free = GUICtrlCreateInput("", 152, 20, 140, 17, $ES_READONLY)
    $tb_src_Belegt = GUICtrlCreateInput("", 8, 70, 140, 17, $ES_READONLY)
    $tb_src_Prozent = GUICtrlCreateInput("", 152, 70, 57, 17, $ES_READONLY)
    $pg_Quelle = GUICtrlCreateProgress(8, 45, 284, 17)
    $bn_Return = GUICtrlCreateButton("zurück", 212, 80, 75, 25, 0)

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

    GUISetState(@SW_SHOW, $GUI)

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

    ; starten Func _LW_info()
    _LW_info()

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

    While 1
    $msg = GUIGetMsg(1)
    Switch $msg[1] ; window-handle
    Case $GUI
    Switch $msg[0] ; event/control-handle
    Case $bn_Pic
    GUISetState(@SW_HIDE, $GUI)
    GUISetState(@SW_SHOW, $GUI_Stick)
    Case $GUI_EVENT_CLOSE
    Exit
    Case $bn_Close
    Exit
    Case $bn_Autor
    $logfile = FileOpen("TheStick.log", 0) ; 0 = nur Lesemodus (read mode)
    If $logfile = -1 Then
    MsgBox(0, "Error", " Die Datei TheStick.log konnte nicht geöffnet werden.", 5)
    Exit
    EndIf
    $line = FileReadLine($logfile)
    If @error = -1 Then ExitLoop
    MsgBox(64, 'About', 'The Stick v 2.2.03 Build 2008-01-03/14 ' & @CRLF & '' & @CRLF & 'Copyright by : Ritzelrocker04 ' & @CRLF & 'Thx an das http://www.Autoit.de - Team ' & @CRLF & '' & @CRLF & 'Die letzte Sicherung war am : ' & @CRLF & $line)
    FileClose($logfile)
    Case $bn_Sichern
    $_Userwahlsich = MsgBox(32+4, " Sichern", "Sichern, möchten Sie fortfahren ? ")
    If $_Userwahlsich = 7 Then
    MsgBox(48, " Sichern", " ...es wurden keine Daten gesichert ! ")
    Exit
    EndIf
    MsgBox(48, " OK", "Simulation des Kopiervorgangs (siehe Zeile 73 & 74) ! ") ; NUR DUMMI !
    ; ==> RunWait('USBsys\7za.exe a -tzip "' & @MyDocumentsDir & '\My Stick\USB-Stick-0"' & @WDAY & '".zip" "' & $src_LW, @MyDocumentsDir, @SW_MINIMIZE)
    _LW_info() ; starten Func _LW_info()
    _Log_Write() ; starten Func _Log_Write()
    SoundSetWaveVolume(50) ;(50)Lautstärke in %
    SoundPlay($uccess, 1) ; 1 = Skript wartet, bis der Sound abgespielt ist.
    MsgBox(64, " Sicherung", " Sicherung abgeschlossen ! ")
    Exit
    EndSwitch
    Case $GUI_Stick
    Switch $msg[0]
    Case $bn_Return
    GUISetState(@SW_SHOW, $GUI)
    GUISetState(@SW_HIDE, $GUI_Stick)
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_SHOW, $GUI)
    GUISetState(@SW_HIDE, $GUI_Stick)
    EndSwitch
    EndSwitch
    WEnd

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

    ; die Funktion _LW_info()
    Func _LW_info()

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

    ; Quelle
    $VOL_Quelle = DriveGetLabel($src_LW)
    $TOTAL_Quelle = DriveSpaceTotal($src_LW)
    $FREE_Quelle = DriveSpaceFree($src_LW)
    $FREE_Quelle_Prozent = StringReplace(Round(($FREE_Quelle) / ($TOTAL_Quelle / 100), 0), ".", ",")
    $FREE_Quelle_MB = _StringAddComma(StringReplace(Round ($FREE_Quelle, 2), '.', ','), ".", ",")
    $Belegt_Quelle_MB = _StringAddComma(StringReplace(Round ($TOTAL_Quelle - $FREE_Quelle, 2), '.', ','), ".", ",")
    $TOTAL_Quelle_MB = _StringAddComma(StringReplace(Round ($TOTAL_Quelle, 2), '.', ','), ".", ",")
    $i_Progress_Quelle = StringReplace(Round(($TOTAL_Quelle - $FREE_Quelle) / ($TOTAL_Quelle / 100), 2), ".", ",")

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

    ; Ziel
    $VOL_Ziel = DriveGetLabel($dest_LW)
    $TOTAL_Ziel = DriveSpaceTotal($dest_LW)
    $FREE_Ziel = DriveSpaceFree($dest_LW)
    $FREE_Ziel_Prozent = StringReplace(Round(($FREE_Ziel) / ($TOTAL_Ziel / 100), 0), ".", ",")
    $FREE_Ziel_MB = _StringAddComma(StringReplace(Round ($FREE_Ziel, 2), '.', ','), ".", ",")
    $i_Progress_Ziel = StringReplace(Round(($TOTAL_Ziel - $FREE_Ziel) / ($TOTAL_Ziel / 100), 2), ".", ",")

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

    ; letzte Berechnungen und setzen der Ergebnisse
    ; Ziel
    GUICtrlSetData($pg_Ziel, $i_Progress_Ziel)
    GUICtrlSetData($gb_Ziel, "( " & $dest_LW & " )" & " = " & $FREE_Ziel_MB & " MB = " & $FREE_Ziel_Prozent & " % frei ")
    ; Quelle
    GUICtrlSetData($tb_src_Total, "Gesamt: " & $TOTAL_Quelle_MB & " MB")
    GUICtrlSetData($tb_src_Free, "Frei: " & $FREE_Quelle_MB & " MB")
    GUICtrlSetData($pg_Quelle, $i_Progress_Quelle)
    GUICtrlSetData($tb_src_Belegt, "Belegt: " & $Belegt_Quelle_MB & " MB")
    GUICtrlSetData($tb_src_Prozent, "Frei: " & $FREE_Quelle_Prozent & " %")

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

    EndFunc ; ==> _LW_info()

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

    ; die Funktion _Log_Write()
    Func _Log_Write()

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

    $logfile = FileOpen("TheStick.log", 2) ;2 = Schreibmodus mit Löschen des vorherigen Inhaltes

    If $logfile = -1 Then
    MsgBox(0, "Error", " Die Datei TheStick.log konnte nicht geöffnet werden.", 5)
    Exit
    EndIf

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

    FileWriteLine($logfile, @MDAY & "." & @MON & "." & @YEAR & " um " & @HOUR & ":" & @MIN & ":" & @SEC & " Uhr ")
    FileClose($logfile)

    EndFunc ; ==> _Log_Write()

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

    Schönes WE und weiterhin
    viel Spaß !

  • Bau doch noch SoundGetVolume von HIER ein, damit die Lautstärke wieder auf den Originalwet zurückgestellt wird

  • geht es um Fehlerbereinigung. :rolleyes:

    Changelog

    0.Die GUIs werden nicht mehr überlagert.
    1.Die GUIs wechseln jetzt richtig zackig.
    2.Das Programm wird nicht mehr abgeschaltet, wenn die Logdatei fehlt.
    3.Logdatei wird selbst erstellt, wenn sie fehlt.

    Spoiler anzeigen
    [autoit]


    ; by Ritzelrocker04 ==> USBv22_031.au3

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

    #include <GUIConstants.au3>
    #include <String.au3>

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

    ; Ziel
    Global $dest_LW = StringLeft(@MyDocumentsDir,2)
    ; Quelle
    Global $src_LW = StringLeft(@ScriptDir,2) & "\"

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

    $uccess = "USBsound\Success.wav"

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

    ; - Start - GUI
    $GUI = GUICreate(" USB v 2.2", 300, 115, -1, 183, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
    GUICtrlCreatePic("USBskin\Blau43.jpg", 0, 0, 300, 115)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $gb_Ziel = GUICtrlCreateGroup("", 64, 8, 225, 60)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $pg_Ziel = GUICtrlCreateProgress(75, 32, 195, 17)
    $bn_Pic = GUICtrlCreateButton("PicButton", 8, 14, 55, 55, $BS_BITMAP)
    GUICtrlSetImage (-1, "USBsys\images3.bmp", 22)
    $bn_Sichern = GUICtrlCreateButton("&Sichern", 126, 80, 75, 25, 0)
    GUICtrlSetState(-1, $GUI_DEFBUTTON)
    $bn_Close = GUICtrlCreateButton("&Beenden", 212, 80, 75, 25, 0)
    $bn_Autor = GUICtrlCreateButton("RR04", 2, 96, 30, 17)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetColor(-1, 0x808080)

    ; - The Stick - GUI
    $GUI_Stick = GUICreate(" The Stick", 300, 115, -1, 183, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
    GUICtrlCreatePic("USBskin\Blau43.jpg", 0, 0, 300, 115)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $tb_src_Total = GUICtrlCreateInput("", 8, 20, 140, 17, $ES_READONLY)
    $tb_src_Free = GUICtrlCreateInput("", 152, 20, 140, 17, $ES_READONLY)
    $tb_src_Belegt = GUICtrlCreateInput("", 8, 70, 140, 17, $ES_READONLY)
    $tb_src_Prozent = GUICtrlCreateInput("", 152, 70, 57, 17, $ES_READONLY)
    $pg_Quelle = GUICtrlCreateProgress(8, 45, 284, 17)
    $bn_Return = GUICtrlCreateButton("zurück", 212, 80, 75, 25, 0)

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

    GUISetState(@SW_SHOW, $GUI)

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

    ; starten Func _LW_info()
    _LW_info()

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

    While 1
    $msg = GUIGetMsg(1)
    Switch $msg[1] ; window-handle
    Case $GUI
    Switch $msg[0] ; event/control-handle
    Case $bn_Pic
    GUISetState(@SW_HIDE, $GUI)
    GUISetState(@SW_SHOW, $GUI_Stick)
    Case $GUI_EVENT_CLOSE
    Exit
    Case $bn_Close
    Exit
    Case $bn_Autor
    $logfile = FileOpen("TheStick.log", 0) ; 0 = nur Lesemodus (read mode)
    If $logfile = -1 Then
    MsgBox(0, "Error", " Die Datei TheStick.log konnte nicht geöffnet werden.", 5)
    EndIf
    $line = FileReadLine($logfile)
    MsgBox(64, 'About', 'The Stick v 2.2.031 Build 2008-01-03/18 ' & @CRLF & '' & @CRLF & 'Copyright by : Ritzelrocker04 ' & @CRLF & 'Thx an das http://www.Autoit.de - Team ' & @CRLF & '' & @CRLF & 'Die letzte Sicherung war am : ' & @CRLF & $line)
    FileClose($logfile)
    Case $bn_Sichern
    $_Userwahlsich = MsgBox(32+4, " Sichern", "Sichern, möchten Sie fortfahren ? ")
    If $_Userwahlsich = 7 Then
    MsgBox(48, " Sichern", " ...es wurden keine Daten gesichert ! ")
    Exit
    EndIf
    MsgBox(48, " OK", "Simulation des Kopiervorgangs (siehe Script-Zeile 71 & 72) ! ")
    ; ==> RunWait('USBsys\7za.exe a -tzip "' & @MyDocumentsDir & '\My Stick\USB-Stick-0"' & @WDAY & '".zip" "' & $src_LW, @MyDocumentsDir, @SW_MINIMIZE)
    _LW_info() ; starten Func _LW_info()
    _Log_Write() ; starten Func _Log_Write()
    SoundSetWaveVolume(50) ;(50)Lautstärke in %
    SoundPlay($uccess, 1) ; 1 = Skript wartet, bis der Sound abgespielt ist.
    MsgBox(64, " Sicherung", " Sicherung abgeschlossen ! ")
    Exit
    EndSwitch
    Case $GUI_Stick
    Switch $msg[0]
    Case $bn_Return
    GUISetState(@SW_SHOW, $GUI)
    GUISetState(@SW_HIDE, $GUI_Stick)
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_SHOW, $GUI)
    GUISetState(@SW_HIDE, $GUI_Stick)
    EndSwitch
    EndSwitch
    WEnd

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

    ; die Funktion _LW_info()
    Func _LW_info()

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

    ; Quelle
    $VOL_Quelle = DriveGetLabel($src_LW)
    $TOTAL_Quelle = DriveSpaceTotal($src_LW)
    $FREE_Quelle = DriveSpaceFree($src_LW)
    $FREE_Quelle_Prozent = StringReplace(Round(($FREE_Quelle) / ($TOTAL_Quelle / 100), 0), ".", ",")
    $FREE_Quelle_MB = _StringAddComma(StringReplace(Round ($FREE_Quelle, 2), '.', ','), ".", ",")
    $Belegt_Quelle_MB = _StringAddComma(StringReplace(Round ($TOTAL_Quelle - $FREE_Quelle, 2), '.', ','), ".", ",")
    $TOTAL_Quelle_MB = _StringAddComma(StringReplace(Round ($TOTAL_Quelle, 2), '.', ','), ".", ",")
    $i_Progress_Quelle = StringReplace(Round(($TOTAL_Quelle - $FREE_Quelle) / ($TOTAL_Quelle / 100), 2), ".", ",")

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

    ; Ziel
    $VOL_Ziel = DriveGetLabel($dest_LW)
    $TOTAL_Ziel = DriveSpaceTotal($dest_LW)
    $FREE_Ziel = DriveSpaceFree($dest_LW)
    $FREE_Ziel_Prozent = StringReplace(Round(($FREE_Ziel) / ($TOTAL_Ziel / 100), 0), ".", ",")
    $FREE_Ziel_MB = _StringAddComma(StringReplace(Round ($FREE_Ziel, 2), '.', ','), ".", ",")
    $i_Progress_Ziel = StringReplace(Round(($TOTAL_Ziel - $FREE_Ziel) / ($TOTAL_Ziel / 100), 2), ".", ",")

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

    ; letzte Berechnungen und setzen der Ergebnisse
    ; Ziel
    GUICtrlSetData($pg_Ziel, $i_Progress_Ziel)
    GUICtrlSetData($gb_Ziel, "( " & $dest_LW & " )" & " = " & $FREE_Ziel_MB & " MB = " & $FREE_Ziel_Prozent & " % frei ")
    ; Quelle
    GUICtrlSetData($tb_src_Total, "Gesamt: " & $TOTAL_Quelle_MB & " MB")
    GUICtrlSetData($tb_src_Free, "Frei: " & $FREE_Quelle_MB & " MB")
    GUICtrlSetData($pg_Quelle, $i_Progress_Quelle)
    GUICtrlSetData($tb_src_Belegt, "Belegt: " & $Belegt_Quelle_MB & " MB")
    GUICtrlSetData($tb_src_Prozent, "Frei: " & $FREE_Quelle_Prozent & " %")

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

    EndFunc ; ==> _LW_info()

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

    ; die Funktion _Log_Write()
    Func _Log_Write()

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

    $logfile = FileOpen("TheStick.log", 2) ;2 = Schreibmodus mit Löschen des vorherigen Inhaltes

    If $logfile = -1 Then
    MsgBox(0, "Error", " Die Datei TheStick.log konnte nicht geöffnet werden.", 5)
    Exit
    EndIf

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

    FileWriteLine($logfile, @MDAY & "." & @MON & "." & @YEAR & " um " & @HOUR & ":" & @MIN & ":" & @SEC & " Uhr ")
    FileClose($logfile)

    EndFunc ; ==> _Log_Write()

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

    Schönes WE und weiterhin
    viel Spaß !

  • gibt es auch noch :!::rolleyes:

    PS: Zeile 79 = Dummy

    Spoiler anzeigen
    [autoit]


    ; by Ritzelrocker04 ==> USBv2_112.au3

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

    #include <GUIConstants.au3>
    #include <String.au3>

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

    ; Ziel
    Global $dest_LW = "E:"
    ; Quelle
    Global $src_LW = StringLeft(@ScriptDir,2) & "\"

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

    $ComputerName = "Ritzelrocker04" ; Hier anpassen !
    $uccess = "USBsound\Success.wav"
    $orry = "USBsound\Sorry.wav"

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

    $GUI = GUICreate(" USB v 2.1", 300, 115, -1, 183, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
    GUICtrlCreatePic("USBskin\Blau41.jpg", 0, 0, 300, 115)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $gb_Ziel = GUICtrlCreateGroup("", 64, 8, 225, 60)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $pg_Ziel = GUICtrlCreateProgress(75, 32, 195, 17)
    $bn_Pic = GUICtrlCreateButton("PicButton", 8, 14, 55, 55, $BS_BITMAP)
    GUICtrlSetImage (-1, "USBsys\images3.bmp", 22)
    $bn_Sichern = GUICtrlCreateButton("&Sichern", 126, 80, 75, 25, 0)
    GUICtrlSetState(-1, $GUI_DEFBUTTON)
    $bn_Close = GUICtrlCreateButton("&Beenden", 212, 80, 75, 25, 0)
    $bn_Autor = GUICtrlCreateButton("RR04", 2, 96, 30, 17)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetColor(-1, 0x808080)

    ; Quelle - The Stick - GUI
    $GUI_Stick = GUICreate(" The Stick", 300, 115, -1, 183, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
    GUICtrlCreatePic("USBskin\Blau41.jpg", 0, 0, 300, 115)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $tb_src_Total = GUICtrlCreateInput("", 8, 20, 140, 17, $ES_READONLY)
    $tb_src_Free = GUICtrlCreateInput("", 152, 20, 140, 17, $ES_READONLY)
    $tb_src_Belegt = GUICtrlCreateInput("", 8, 70, 140, 17, $ES_READONLY)
    $tb_src_Prozent = GUICtrlCreateInput("", 152, 70, 57, 17, $ES_READONLY)
    $pg_Quelle = GUICtrlCreateProgress(8, 45, 284, 17)
    $bn_Return = GUICtrlCreateButton("zurück", 212, 80, 75, 25, 0)

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

    GUISetState(@SW_SHOW, $GUI)

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

    ; starten Func _LW_info()
    _LW_info()

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

    While 1
    $msg = GUIGetMsg(1)
    Switch $msg[1] ; window-handle
    Case $GUI
    Switch $msg[0] ; event/control-handle
    Case $bn_Pic
    GUISetState(@SW_HIDE, $GUI)
    GUISetState(@SW_SHOW, $GUI_Stick)
    Case $GUI_EVENT_CLOSE
    Exit
    Case $bn_Close
    Exit
    Case $bn_Autor
    $logfile = FileOpen("TheStick.log", 0) ; 0 = nur Lesemodus (read mode)
    If $logfile = -1 Then
    MsgBox(0, "Error", " Die Datei TheStick.log konnte nicht geöffnet werden.", 5)
    EndIf
    $line = FileReadLine($logfile)
    MsgBox(64, 'About', 'The Stick v 2.1.12 Build 2008-01-03/21 ' & @CRLF & '' & @CRLF & 'Copyright by : Ritzelrocker04 ' & @CRLF & 'Thx an das http://www.Autoit.de - Team ' & @CRLF & '' & @CRLF & 'Die letzte Sicherung war am : ' & @CRLF & $line)
    FileClose($logfile)
    Case $bn_Sichern
    If $ComputerName = @ComputerName Then
    If FileExists($dest_LW & "\$Backup$\$USB-SecurityStick$\USB-SecurityStick-0" & @WDAY & ".zip ") Then
    $ExistsFileWahl = MsgBox(32+4, "Löschen", 'Möchten Sie die bereits existierende Datei "USB-SecurityStick-0' & @WDAY & '.zip" löschen ? ')
    If $ExistsFileWahl = 6 Then
    FileDelete($dest_LW & "\$Backup$\$USB-SecurityStick$\USB-SecurityStick-0" & @WDAY & ".zip ")
    EndIf
    EndIf
    $_Userwahlsich = MsgBox(32+4, " Sichern", "Sichern, möchten Sie fortfahren ? ")
    If $_Userwahlsich = 7 Then
    MsgBox(48, " Sichern", " ...es wurden keine Daten gesichert ! ")
    Exit
    EndIf
    MsgBox(48, " OK", "Simulation des Kopiervorgangs (siehe Script-Dummi) ! ")
    ; ==> RunWait(@ComSpec & ' /c ' & "USBsys\7za.exe a -tzip " & $dest_LW & "\$Backup$\$USB-SecurityStick$\USB-SecurityStick-0" & @WDAY & ".zip " & '"\"',@ScriptDir ,@SW_MINIMIZE)
    _LW_info() ; starten Func _LW_info()
    _Log_Write() ; starten Func _Log_Write()
    ;SoundSetWaveVolume(50) ; optional (50)Lautstärke in %
    SoundPlay($uccess, 1) ; 1 = Skript wartet, bis der Sound abgespielt ist.
    MsgBox(64, " Sicherung", " Sicherung abgeschlossen ! ")
    Exit
    Else
    ;SoundSetWaveVolume(50) ; optional (50)Lautstärke in %
    SoundPlay($orry, 1) ; 1 = Skript wartet, bis der Sound abgespielt ist.
    MsgBox(16, " Sorry", "Falscher Computer - Sie haben keine Berechtigung ! ")
    EndIf
    EndSwitch
    Case $GUI_Stick
    Switch $msg[0]
    Case $bn_Return
    GUISetState(@SW_SHOW, $GUI)
    GUISetState(@SW_HIDE, $GUI_Stick)
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_SHOW, $GUI)
    GUISetState(@SW_HIDE, $GUI_Stick)
    EndSwitch
    EndSwitch
    WEnd

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

    ; die Funktion _LW_info()
    Func _LW_info()

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

    ; Quelle
    $VOL_Quelle = DriveGetLabel($src_LW)
    $TOTAL_Quelle = DriveSpaceTotal($src_LW)
    $FREE_Quelle = DriveSpaceFree($src_LW)
    $FREE_Quelle_Prozent = StringReplace(Round(($FREE_Quelle) / ($TOTAL_Quelle / 100), 0), ".", ",")
    $FREE_Quelle_MB = _StringAddComma(StringReplace(Round ($FREE_Quelle, 2), '.', ','), ".", ",")
    $Belegt_Quelle_MB = _StringAddComma(StringReplace(Round ($TOTAL_Quelle - $FREE_Quelle, 2), '.', ','), ".", ",")
    $TOTAL_Quelle_MB = _StringAddComma(StringReplace(Round ($TOTAL_Quelle, 2), '.', ','), ".", ",")
    $i_Progress_Quelle = StringReplace(Round(($TOTAL_Quelle - $FREE_Quelle) / ($TOTAL_Quelle / 100), 2), ".", ",")

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

    ; Ziel
    $VOL_Ziel = DriveGetLabel($dest_LW)
    $TOTAL_Ziel = DriveSpaceTotal($dest_LW)
    $FREE_Ziel = DriveSpaceFree($dest_LW)
    $FREE_Ziel_Prozent = StringReplace(Round(($FREE_Ziel) / ($TOTAL_Ziel / 100), 0), ".", ",")
    $FREE_Ziel_MB = _StringAddComma(StringReplace(Round ($FREE_Ziel, 2), '.', ','), ".", ",")
    $i_Progress_Ziel = StringReplace(Round(($TOTAL_Ziel - $FREE_Ziel) / ($TOTAL_Ziel / 100), 2), ".", ",")

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

    ; letzte Berechnungen und setzen der Ergebnisse
    ; Ziel
    GUICtrlSetData($pg_Ziel, $i_Progress_Ziel)
    GUICtrlSetData($gb_Ziel, "( " & $dest_LW & " )" & " = " & $FREE_Ziel_MB & " MB = " & $FREE_Ziel_Prozent & " % frei ")
    ; Quelle
    GUICtrlSetData($tb_src_Total, "Gesamt: " & $TOTAL_Quelle_MB & " MB")
    GUICtrlSetData($tb_src_Free, "Frei: " & $FREE_Quelle_MB & " MB")
    GUICtrlSetData($pg_Quelle, $i_Progress_Quelle)
    GUICtrlSetData($tb_src_Belegt, "Belegt: " & $Belegt_Quelle_MB & " MB")
    GUICtrlSetData($tb_src_Prozent, "Frei: " & $FREE_Quelle_Prozent & " %")

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

    EndFunc ; ==> _LW_info()

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

    ; die Funktion _Log_Write()
    Func _Log_Write()

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

    $logfile = FileOpen("TheStick.log", 2) ;2 = Schreibmodus mit Löschen des vorherigen Inhaltes

    If $logfile = -1 Then
    MsgBox(0, "Error", " Die Datei TheStick.log konnte nicht geöffnet werden.", 5)
    Exit
    EndIf

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

    FileWriteLine($logfile, @MDAY & "." & @MON & "." & @YEAR & " um " & @HOUR & ":" & @MIN & ":" & @SEC & " Uhr ")
    FileClose($logfile)

    EndFunc ; ==> _Log_Write()

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

    Weiterhin viel Spaß !

  • ist natürlich die Gängige. Beide Versionen, bitte nicht verwechseln :!::thumbup:
    PS: Zeile 77 = Dummy

    Spoiler anzeigen
    [autoit]


    ; by Ritzelrocker04 ==> USBv2204.au3

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

    #include <GUIConstants.au3>
    #include <String.au3>

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

    ; Ziel
    Global $dest_LW = StringLeft(@MyDocumentsDir,2)
    ; Quelle
    Global $src_LW = StringLeft(@ScriptDir,2) & "\"

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

    $uccess = "USBsound\Success.wav"

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

    ; - Start - GUI
    $GUI = GUICreate(" USB v 2.2", 300, 115, -1, 183, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
    GUICtrlCreatePic("USBskin\Blau43.jpg", 0, 0, 300, 115)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $gb_Ziel = GUICtrlCreateGroup("", 64, 8, 225, 60)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $pg_Ziel = GUICtrlCreateProgress(75, 32, 195, 17)
    $bn_Pic = GUICtrlCreateButton("PicButton", 8, 14, 55, 55, $BS_BITMAP)
    GUICtrlSetImage (-1, "USBsys\images3.bmp", 22)
    $bn_Sichern = GUICtrlCreateButton("&Sichern", 126, 80, 75, 25, 0)
    GUICtrlSetState(-1, $GUI_DEFBUTTON)
    $bn_Close = GUICtrlCreateButton("&Beenden", 212, 80, 75, 25, 0)
    $bn_Autor = GUICtrlCreateButton("RR04", 2, 96, 30, 17)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetColor(-1, 0x808080)

    ; - The Stick - GUI
    $GUI_Stick = GUICreate(" The Stick", 300, 115, -1, 183, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
    GUICtrlCreatePic("USBskin\Blau43.jpg", 0, 0, 300, 115)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $tb_src_Total = GUICtrlCreateInput("", 8, 20, 140, 17, $ES_READONLY)
    $tb_src_Free = GUICtrlCreateInput("", 152, 20, 140, 17, $ES_READONLY)
    $tb_src_Belegt = GUICtrlCreateInput("", 8, 70, 140, 17, $ES_READONLY)
    $tb_src_Prozent = GUICtrlCreateInput("", 152, 70, 57, 17, $ES_READONLY)
    $pg_Quelle = GUICtrlCreateProgress(8, 45, 284, 17)
    $bn_Return = GUICtrlCreateButton("zurück", 212, 80, 75, 25, 0)

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

    GUISetState(@SW_SHOW, $GUI)

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

    ; starten Func _LW_info()
    _LW_info()

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

    While 1
    $msg = GUIGetMsg(1)
    Switch $msg[1] ; window-handle
    Case $GUI
    Switch $msg[0] ; event/control-handle
    Case $bn_Pic
    GUISetState(@SW_HIDE, $GUI)
    GUISetState(@SW_SHOW, $GUI_Stick)
    Case $GUI_EVENT_CLOSE
    Exit
    Case $bn_Close
    Exit
    Case $bn_Autor
    $logfile = FileOpen("TheStick.log", 0) ; 0 = nur Lesemodus (read mode)
    If $logfile = -1 Then
    MsgBox(0, "Error", " Die Datei TheStick.log konnte nicht geöffnet werden.", 5)
    EndIf
    $line = FileReadLine($logfile)
    MsgBox(64, 'About', 'The Stick v 2.2.04 Build 2008-01-03/21 ' & @CRLF & '' & @CRLF & 'Copyright by : Ritzelrocker04 ' & @CRLF & 'Thx an das http://www.Autoit.de - Team ' & @CRLF & '' & @CRLF & 'Die letzte Sicherung war am : ' & @CRLF & $line)
    FileClose($logfile)
    Case $bn_Sichern
    If FileExists(@MyDocumentsDir & '\My Stick\USB-Stick-0' & @WDAY & '.zip') Then
    $ExistsFileWahl = MsgBox(32+4, "Löschen", 'Möchten Sie die bereits existierende Datei "USB-Stick-0' & @WDAY & '.zip" löschen ? ')
    If $ExistsFileWahl = 6 Then
    FileDelete(@MyDocumentsDir & '\My Stick\USB-Stick-0' & @WDAY & '.zip')
    EndIf
    EndIf
    $_Userwahlsich = MsgBox(32+4, " Sichern", "Sichern, möchten Sie fortfahren ? ")
    If $_Userwahlsich = 7 Then
    MsgBox(48, " Sichern", " ...es wurden keine Daten gesichert ! ")
    Exit
    EndIf
    MsgBox(48, " OK", "Simulation des Kopiervorgangs (Dummi, siehe Script-Zeile 77 & 78) ! ")
    ; ==> RunWait('USBsys\7za.exe a -tzip "' & @MyDocumentsDir & '\My Stick\USB-Stick-0"' & @WDAY & '".zip" "' & $src_LW, @MyDocumentsDir, @SW_MINIMIZE)
    _LW_info() ; starten Func _LW_info()
    _Log_Write() ; starten Func _Log_Write()
    ;SoundSetWaveVolume(50) ; optional (50)Lautstärke in %
    SoundPlay($uccess, 1) ; 1 = Skript wartet, bis der Sound abgespielt ist.
    MsgBox(64, " Sicherung", " Sicherung abgeschlossen ! ")
    Exit
    EndSwitch
    Case $GUI_Stick
    Switch $msg[0]
    Case $bn_Return
    GUISetState(@SW_SHOW, $GUI)
    GUISetState(@SW_HIDE, $GUI_Stick)
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_SHOW, $GUI)
    GUISetState(@SW_HIDE, $GUI_Stick)
    EndSwitch
    EndSwitch
    WEnd

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

    ; die Funktion _LW_info()
    Func _LW_info()

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

    ; Quelle
    $VOL_Quelle = DriveGetLabel($src_LW)
    $TOTAL_Quelle = DriveSpaceTotal($src_LW)
    $FREE_Quelle = DriveSpaceFree($src_LW)
    $FREE_Quelle_Prozent = StringReplace(Round(($FREE_Quelle) / ($TOTAL_Quelle / 100), 0), ".", ",")
    $FREE_Quelle_MB = _StringAddComma(StringReplace(Round ($FREE_Quelle, 2), '.', ','), ".", ",")
    $Belegt_Quelle_MB = _StringAddComma(StringReplace(Round ($TOTAL_Quelle - $FREE_Quelle, 2), '.', ','), ".", ",")
    $TOTAL_Quelle_MB = _StringAddComma(StringReplace(Round ($TOTAL_Quelle, 2), '.', ','), ".", ",")
    $i_Progress_Quelle = StringReplace(Round(($TOTAL_Quelle - $FREE_Quelle) / ($TOTAL_Quelle / 100), 2), ".", ",")

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

    ; Ziel
    $VOL_Ziel = DriveGetLabel($dest_LW)
    $TOTAL_Ziel = DriveSpaceTotal($dest_LW)
    $FREE_Ziel = DriveSpaceFree($dest_LW)
    $FREE_Ziel_Prozent = StringReplace(Round(($FREE_Ziel) / ($TOTAL_Ziel / 100), 0), ".", ",")
    $FREE_Ziel_MB = _StringAddComma(StringReplace(Round ($FREE_Ziel, 2), '.', ','), ".", ",")
    $i_Progress_Ziel = StringReplace(Round(($TOTAL_Ziel - $FREE_Ziel) / ($TOTAL_Ziel / 100), 2), ".", ",")

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

    ; letzte Berechnungen und setzen der Ergebnisse
    ; Ziel
    GUICtrlSetData($pg_Ziel, $i_Progress_Ziel)
    GUICtrlSetData($gb_Ziel, "( " & $dest_LW & " )" & " = " & $FREE_Ziel_MB & " MB = " & $FREE_Ziel_Prozent & " % frei ")
    ; Quelle
    GUICtrlSetData($tb_src_Total, "Gesamt: " & $TOTAL_Quelle_MB & " MB")
    GUICtrlSetData($tb_src_Free, "Frei: " & $FREE_Quelle_MB & " MB")
    GUICtrlSetData($pg_Quelle, $i_Progress_Quelle)
    GUICtrlSetData($tb_src_Belegt, "Belegt: " & $Belegt_Quelle_MB & " MB")
    GUICtrlSetData($tb_src_Prozent, "Frei: " & $FREE_Quelle_Prozent & " %")

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

    EndFunc ; ==> _LW_info()

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

    ; die Funktion _Log_Write()
    Func _Log_Write()

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

    $logfile = FileOpen("TheStick.log", 2) ;2 = Schreibmodus mit Löschen des vorherigen Inhaltes

    If $logfile = -1 Then
    MsgBox(0, "Error", " Die Datei TheStick.log konnte nicht geöffnet werden.", 5)
    Exit
    EndIf

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

    FileWriteLine($logfile, @MDAY & "." & @MON & "." & @YEAR & " um " & @HOUR & ":" & @MIN & ":" & @SEC & " Uhr ")
    FileClose($logfile)

    EndFunc ; ==> _Log_Write()

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

    Weiterhin viel Spaß !

  • Anpassung an die neuen AutoIT-Versionen
    PS: Zeile 81 = Dummy

    Spoiler anzeigen
    [autoit]


    ; by Ritzelrocker04 ==> siehe $version

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

    #include<ButtonConstants.au3>
    #include<EditConstants.au3>
    #include<GUIConstantsEx.au3>
    #include<String.au3>
    #include<WindowsConstants.au3>

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

    ; Ziel
    Global $dest_LW = StringLeft(@MyDocumentsDir,2)
    ; Quelle
    Global $src_LW = StringLeft(@ScriptDir,2) & "\"

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

    $version = " USB v 3.0"
    $uccess = "USBsound\Success.wav"

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

    ; - Start - GUI
    $GUI = GUICreate($version, 300, 115, -1, 183, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
    GUICtrlCreatePic("USBskin\Blau43.jpg", 0, 0, 300, 115)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $gb_Ziel = GUICtrlCreateGroup("", 64, 8, 225, 60)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $pg_Ziel = GUICtrlCreateProgress(75, 32, 195, 17)
    $bn_Pic = GUICtrlCreateButton("PicButton", 8, 14, 55, 55, $BS_BITMAP)
    GUICtrlSetImage (-1, "USBsys\images3.bmp", 22)
    $bn_Sichern = GUICtrlCreateButton("&Sichern", 126, 80, 75, 25, 0)
    GUICtrlSetState(-1, $GUI_DEFBUTTON)
    $bn_Close = GUICtrlCreateButton("&Beenden", 212, 80, 75, 25, 0)
    $bn_Autor = GUICtrlCreateButton("RR04", 2, 96, 30, 17)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetColor(-1, 0x808080)

    ; - The Stick - GUI
    $GUI_Stick = GUICreate(" The Stick", 300, 115, -1, 183, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
    GUICtrlCreatePic("USBskin\Blau43.jpg", 0, 0, 300, 115)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $tb_src_Total = GUICtrlCreateInput("", 8, 20, 140, 17, $ES_READONLY)
    $tb_src_Free = GUICtrlCreateInput("", 152, 20, 140, 17, $ES_READONLY)
    $tb_src_Belegt = GUICtrlCreateInput("", 8, 70, 140, 17, $ES_READONLY)
    $tb_src_Prozent = GUICtrlCreateInput("", 152, 70, 57, 17, $ES_READONLY)
    $pg_Quelle = GUICtrlCreateProgress(8, 45, 284, 17)
    $bn_Return = GUICtrlCreateButton("zurück", 212, 80, 75, 25, 0)

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

    GUISetState(@SW_SHOW, $GUI)

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

    ; starten Func _LW_info()
    _LW_info()

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

    While 1
    $msg = GUIGetMsg(1)
    Switch $msg[1] ; window-handle
    Case $GUI
    Switch $msg[0] ; event/control-handle
    Case $bn_Pic
    GUISetState(@SW_HIDE, $GUI)
    GUISetState(@SW_SHOW, $GUI_Stick)
    Case $GUI_EVENT_CLOSE
    Exit
    Case $bn_Close
    Exit
    Case $bn_Autor
    $logfile = FileOpen("TheStick.log", 0) ; 0 = nur Lesemodus (read mode)
    If $logfile = -1 Then
    MsgBox(0, "Error", " Die Datei TheStick.log konnte nicht geöffnet werden.", 5)
    EndIf
    $line = FileReadLine($logfile)
    MsgBox(64, 'About', 'The Stick v 3.0.00 Build 2008-03-02 ' & @CRLF & '' & @CRLF & 'Copyright by : Ritzelrocker04 ' & @CRLF & 'Thx an das http://www.Autoit.de - Team ' & @CRLF & '' & @CRLF & 'Die letzte Sicherung war am : ' & @CRLF & $line)
    FileClose($logfile)
    Case $bn_Sichern
    If FileExists(@MyDocumentsDir & '\My Stick\USB-Stick-0' & @WDAY & '.zip') Then
    $ExistsFileWahl = MsgBox(32+4, "Löschen", 'Möchten Sie die bereits existierende Datei "USB-Stick-0' & @WDAY & '.zip" löschen ? ')
    If $ExistsFileWahl = 6 Then
    FileDelete(@MyDocumentsDir & '\My Stick\USB-Stick-0' & @WDAY & '.zip')
    EndIf
    EndIf
    $_Userwahlsich = MsgBox(32+4, " Sichern", "Sichern, möchten Sie fortfahren ? ")
    If $_Userwahlsich = 7 Then
    MsgBox(48, " Sichern", " ...es wurden keine Daten gesichert ! ")
    Exit
    EndIf
    MsgBox(48, " OK", "Simulation des Kopiervorgangs (Dummi, siehe Script-Zeile 80 & 81) ! ")
    ; ==> RunWait('USBsys\7za.exe a -tzip "' & @MyDocumentsDir & '\My Stick\USB-Stick-0"' & @WDAY & '".zip" "' & $src_LW, @MyDocumentsDir, @SW_MINIMIZE)
    _LW_info() ; starten Func _LW_info()
    _Log_Write() ; starten Func _Log_Write()
    ;SoundSetWaveVolume(50) ; optional (50)Lautstärke in %
    SoundPlay($uccess, 1) ; 1 = Skript wartet, bis der Sound abgespielt ist.
    MsgBox(64, " Sicherung", " Sicherung abgeschlossen ! ")
    Exit
    EndSwitch
    Case $GUI_Stick
    Switch $msg[0]
    Case $bn_Return
    GUISetState(@SW_SHOW, $GUI)
    GUISetState(@SW_HIDE, $GUI_Stick)
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_SHOW, $GUI)
    GUISetState(@SW_HIDE, $GUI_Stick)
    EndSwitch
    EndSwitch
    WEnd

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

    ; die Funktion _LW_info()
    Func _LW_info()

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

    ; Quelle
    $VOL_Quelle = DriveGetLabel($src_LW)
    $TOTAL_Quelle = DriveSpaceTotal($src_LW)
    $FREE_Quelle = DriveSpaceFree($src_LW)
    $FREE_Quelle_Prozent = StringReplace(Round(($FREE_Quelle) / ($TOTAL_Quelle / 100), 0), ".", ",")
    $FREE_Quelle_MB = _StringAddComma(StringReplace(Round ($FREE_Quelle, 2), '.', ','), ".", ",")
    $Belegt_Quelle_MB = _StringAddComma(StringReplace(Round ($TOTAL_Quelle - $FREE_Quelle, 2), '.', ','), ".", ",")
    $TOTAL_Quelle_MB = _StringAddComma(StringReplace(Round ($TOTAL_Quelle, 2), '.', ','), ".", ",")
    $i_Progress_Quelle = StringReplace(Round(($TOTAL_Quelle - $FREE_Quelle) / ($TOTAL_Quelle / 100), 2), ".", ",")

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

    ; Ziel
    $VOL_Ziel = DriveGetLabel($dest_LW)
    $TOTAL_Ziel = DriveSpaceTotal($dest_LW)
    $FREE_Ziel = DriveSpaceFree($dest_LW)
    $FREE_Ziel_Prozent = StringReplace(Round(($FREE_Ziel) / ($TOTAL_Ziel / 100), 0), ".", ",")
    $FREE_Ziel_MB = _StringAddComma(StringReplace(Round ($FREE_Ziel, 2), '.', ','), ".", ",")
    $i_Progress_Ziel = StringReplace(Round(($TOTAL_Ziel - $FREE_Ziel) / ($TOTAL_Ziel / 100), 2), ".", ",")

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

    ; letzte Berechnungen und setzen der Ergebnisse
    ; Ziel
    GUICtrlSetData($pg_Ziel, $i_Progress_Ziel)
    GUICtrlSetData($gb_Ziel, "( " & $dest_LW & " )" & " = " & $FREE_Ziel_MB & " MB = " & $FREE_Ziel_Prozent & " % frei ")
    ; Quelle
    GUICtrlSetData($tb_src_Total, "Gesamt: " & $TOTAL_Quelle_MB & " MB")
    GUICtrlSetData($tb_src_Free, "Frei: " & $FREE_Quelle_MB & " MB")
    GUICtrlSetData($pg_Quelle, $i_Progress_Quelle)
    GUICtrlSetData($tb_src_Belegt, "Belegt: " & $Belegt_Quelle_MB & " MB")
    GUICtrlSetData($tb_src_Prozent, "Frei: " & $FREE_Quelle_Prozent & " %")

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

    EndFunc ; ==> _LW_info()

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

    ; die Funktion _Log_Write()
    Func _Log_Write()

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

    $logfile = FileOpen("TheStick.log", 2) ;2 = Schreibmodus mit Löschen des vorherigen Inhaltes

    If $logfile = -1 Then
    MsgBox(0, "Error", " Die Datei TheStick.log konnte nicht geöffnet werden.", 5)
    Exit
    EndIf

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

    FileWriteLine($logfile, @MDAY & "." & @MON & "." & @YEAR & " um " & @HOUR & ":" & @MIN & ":" & @SEC & " Uhr ")
    FileClose($logfile)

    EndFunc ; ==> _Log_Write()

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


    Schönes WE und weiterhin
    viel Erfolg ;)

  • Ich habe mein Script noch etwas weiterentwickelt. ;)
    PS: siehe Dummys

    Spoiler anzeigen
    [autoit]


    ; by Ritzelrocker04 ==> siehe $title
    #include<ButtonConstants.au3>
    #include<EditConstants.au3>
    #include<GUIConstantsEx.au3>
    #include<WindowsConstants.au3>
    #include<String.au3>

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

    Global $src_LW = StringLeft(@ScriptDir, 3); Quelle - The Stick

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

    $title = "The Stick v 3.0.15"
    $uccess = "USBsound\Success.wav"

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

    ; - Start - GUI
    $GUI = GUICreate($title, 300, 115, -1, 183, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
    GUICtrlCreatePic("USBskin\Blau43.jpg", 0, 0, 300, 115, 0)
    $gb_Ziel = GUICtrlCreateGroup("", 64, 8, 225, 60)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $pg_Ziel = GUICtrlCreateProgress(75, 32, 195, 17)
    $bn_Pic = GUICtrlCreateButton("PicButton", 8, 14, 55, 55, $BS_BITMAP)
    GUICtrlSetImage(-1, "USBsys\images3.bmp", 22)
    $bn_Sichern = GUICtrlCreateButton("&Sichern", 126, 80, 75, 22, 0)
    GUICtrlSetState(-1, $GUI_DEFBUTTON)
    $bn_Close = GUICtrlCreateButton("&Beenden", 212, 80, 75, 22, 0)
    $bn_Autor = GUICtrlCreateButton("RR04", 2, 96, 30, 17)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetColor(-1, 0x808080)

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

    ; - The Stick - GUI
    $GUI_Stick = GUICreate($title, 300, 115, -1, 183, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
    GUICtrlCreatePic("USBskin\Blau43.jpg", 0, 0, 300, 115)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $tb_src_Total = GUICtrlCreateInput("", 8, 20, 140, 17, $ES_READONLY)
    $tb_src_Free = GUICtrlCreateInput("", 152, 20, 140, 17, $ES_READONLY)
    $tb_src_Belegt = GUICtrlCreateInput("", 8, 70, 140, 17, $ES_READONLY)
    $tb_src_Prozent = GUICtrlCreateInput("", 152, 70, 68, 17, $ES_READONLY)
    $pg_Quelle = GUICtrlCreateProgress(8, 45, 284, 17)
    $bn_Return = GUICtrlCreateButton("zurück", 225, 80, 65, 22, 0)

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

    GUISetState(@SW_SHOW, $GUI)

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

    ; starten Func _LW_info()
    _LW_info()

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

    While 1
    $msg = GUIGetMsg(1)
    Switch $msg[1] ; window-handle
    Case $GUI
    Switch $msg[0] ; event/control-handle
    Case $bn_Pic
    GUISetState(@SW_HIDE, $GUI)
    GUISetState(@SW_SHOW, $GUI_Stick)
    Case $GUI_EVENT_CLOSE
    Exit
    Case $bn_Close
    Exit
    Case $bn_Autor
    $logfile = FileOpen("TheStick.log", 0) ; 0 = nur Lesemodus (read mode)
    If $logfile = -1 Then
    MsgBox(0, "Error", " Die Datei TheStick.log konnte nicht geöffnet werden.", 5)
    Exit
    EndIf
    $line = FileReadLine($logfile)
    MsgBox(64, 'About', $title & ' Build 2008-04-10 ' & @CRLF & '' & @CRLF & 'Copyright by : Ritzelrocker04 ' & @CRLF & 'Thx an das http://www.Autoit.de - Team ' & @CRLF & '' & @CRLF & 'Die letzte Sicherung war am : ' & @CRLF & $line)
    FileClose($logfile)
    Case $bn_Sichern
    If FileExists(@MyDocumentsDir & '\My Stick\USB-Stick-0' & @WDAY & '.zip') Then
    $ExistsFileWahl = MsgBox(48 + 4, " Löschen", 'USB-Stick-0' & @WDAY & '.zip besteht bereits. ' & @CRLF & ' Möchten Sie sie ersetzen ? ')
    If $ExistsFileWahl = 6 Then
    FileDelete(@MyDocumentsDir & '\My Stick\USB-Stick-0' & @WDAY & '.zip')
    EndIf
    EndIf
    $_Userwahlsich = MsgBox(32 + 4, " Sichern", "Sichern, möchten Sie fortfahren ? ")
    If $_Userwahlsich = 7 Then
    MsgBox(48, " Sichern", " ...es wurden keine Daten gesichert ! ")
    Exit
    EndIf
    MsgBox(48, " OK", "Simulation des Kopiervorgangs (Dummi, siehe Script) ! ")
    ; ==> RunWait('USBsys\7za.exe a -tzip "' & @MyDocumentsDir & '\My Stick\USB-Stick-0"' & @WDAY & '".zip" "' & $src_LW, @MyDocumentsDir, @SW_MINIMIZE)
    _LW_info() ; starten Func _LW_info()
    _Log_Write() ; starten Func _Log_Write()
    ;SoundSetWaveVolume(50) ; optional (50)Lautstärke in %
    SoundPlay($uccess, 1) ; 1 = Skript wartet, bis der Sound abgespielt ist.
    MsgBox(64, " Sicherung fertig", " Sicherung abgeschlossen ! ")
    Exit
    EndSwitch
    Case $GUI_Stick
    Switch $msg[0]
    Case $bn_Return
    GUISetState(@SW_SHOW, $GUI)
    GUISetState(@SW_HIDE, $GUI_Stick)
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_SHOW, $GUI)
    GUISetState(@SW_HIDE, $GUI_Stick)
    EndSwitch
    EndSwitch
    WEnd

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

    ; die Funktion _LW_info()
    Func _LW_info()
    Local $dest_LW = StringLeft(@MyDocumentsDir, 2); Ziel - Eigene Dateien
    ; Quelle
    $VOL_Quelle = DriveGetLabel($src_LW)
    $TOTAL_Quelle = DriveSpaceTotal($src_LW)
    $FREE_Quelle = DriveSpaceFree($src_LW)
    ; Ziel
    $TOTAL_Ziel = DriveSpaceTotal($dest_LW)
    $FREE_Ziel = DriveSpaceFree($dest_LW)
    ; Berechnungen und setzen der Ergebnisse
    ; Ziel
    GUICtrlSetData($pg_Ziel, StringReplace(Round(($TOTAL_Ziel - $FREE_Ziel) / ($TOTAL_Ziel / 100), 0), ".", ","))
    GUICtrlSetData($gb_Ziel, "( " & $dest_LW & " )" & " = " & _StringAddComma(StringReplace(Round($FREE_Ziel, 0), '.', ','), ".", ",") & " MB = " & StringReplace(Round(($FREE_Ziel) / ($TOTAL_Ziel / 100), 0), ".", ",") & "% frei ")
    ; Quelle
    GUICtrlSetData($tb_src_Total, "Gesamt: " & _StringAddComma(StringReplace(Round($TOTAL_Quelle, 0), '.', ','), ".", ",") & " MB")
    GUICtrlSetData($tb_src_Free, "Frei: " & _StringAddComma(StringReplace(Round($FREE_Quelle, 0), '.', ','), ".", ",") & " MB")
    GUICtrlSetData($pg_Quelle, StringReplace(Round(($TOTAL_Quelle - $FREE_Quelle) / ($TOTAL_Quelle / 100), 0), ".", ","))
    GUICtrlSetData($tb_src_Belegt, "Belegt: " & _StringAddComma(StringReplace(Round($TOTAL_Quelle - $FREE_Quelle, 0), '.', ','), ".", ",") & " MB")
    GUICtrlSetData($tb_src_Prozent, "Frei: " & StringReplace(Round(($FREE_Quelle) / ($TOTAL_Quelle / 100), 0), ".", ",") & "%")
    EndFunc ;==>_LW_info

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

    ; die Funktion _Log_Write()
    Func _Log_Write()
    $logfile = FileOpen("TheStick.log", 2) ;2 = Schreibmodus mit Löschen des vorherigen Inhaltes
    If $logfile = -1 Then
    MsgBox(0, "Error", " Die Datei TheStick.log konnte nicht geöffnet werden.", 5)
    Exit
    EndIf
    FileWriteLine($logfile, @MDAY & "." & @MON & "." & @YEAR & " um " & @HOUR & ":" & @MIN & ":" & @SEC & " Uhr ")
    FileClose($logfile)
    EndFunc ;==>_Log_Write

    [/autoit]


    Schönes WE und weiterhin viel Spaß !

  • habe ich weiterentwickelt und es sind zwei Funktionen hinzu gekommen. ;)
    PS: siehe Dummys

    Spoiler anzeigen
    [autoit]


    ; by Ritzelrocker04 ==> siehe $title
    #include<ButtonConstants.au3>
    #include<EditConstants.au3>
    #include<GUIConstantsEx.au3>
    #include<WindowsConstants.au3>
    #include<String.au3>

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

    $src_LW = StringLeft(@ScriptDir, 3); Quelle - The Stick
    $dest_LW = StringLeft(@MyDocumentsDir, 2); Ziel - Eigene Dateien

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

    $title = "The Stick v 3.2.30"
    $uccess = "USBsound\Success.wav"

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

    ; - Start - GUI
    $GUI = GUICreate($title, 300, 115, -1, 183, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
    GUICtrlCreatePic("USBskin\Blau43.jpg", 0, 0, 300, 115, 0)
    $gb_Ziel = GUICtrlCreateGroup("", 64, 8, 225, 60) ; open group $gb_Ziel
    $pg_Ziel = GUICtrlCreateProgress(75, 32, 195, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1) ; close group $gb_Ziel
    $bn_Pic = GUICtrlCreateButton("PicButton", 8, 14, 55, 55, $BS_BITMAP)
    GUICtrlSetImage(-1, "USBsys\images3.bmp", 22)
    $bn_Sichern = GUICtrlCreateButton("&Sichern", 126, 80, 75, 22, 0)
    GUICtrlSetState(-1, $GUI_DEFBUTTON)
    $bn_Close = GUICtrlCreateButton("&Beenden", 212, 80, 75, 22, 0)
    $bn_Autor = GUICtrlCreateButton("RR04", 8, 96, 30, 17)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUICtrlSetColor(-1, 0x808080)

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

    ; - The Stick - GUI
    $GUI_Stick = GUICreate($title, 300, 115, -1, 183, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
    GUICtrlCreatePic("USBskin\Blau43.jpg", 0, 0, 300, 115, 0)
    $tb_src_Total = GUICtrlCreateInput("", 8, 20, 140, 17, $ES_READONLY)
    $tb_src_Free = GUICtrlCreateInput("", 152, 20, 140, 17, $ES_READONLY)
    $tb_src_Belegt = GUICtrlCreateInput("", 8, 70, 140, 17, $ES_READONLY)
    $tb_src_Prozent = GUICtrlCreateInput("", 152, 70, 68, 17, $ES_READONLY)
    $pg_Quelle = GUICtrlCreateProgress(8, 45, 284, 17)
    $bn_Return = GUICtrlCreateButton("zurück", 225, 80, 65, 22, 0)

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

    GUISetState(@SW_SHOW, $GUI)

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

    ; starten Func _infoLW()
    _infoLW()

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

    While 1
    $msg = GUIGetMsg(1)
    Switch $msg[1] ; window-handle
    Case $GUI
    Switch $msg[0] ; event/control-handle
    Case $bn_Pic
    GUISetState(@SW_HIDE, $GUI)
    GUISetState(@SW_SHOW, $GUI_Stick)
    Case $GUI_EVENT_CLOSE
    Exit
    Case $bn_Close
    Exit
    Case $bn_Autor
    $logfile = FileOpen("TheStick.log", 0) ; 0 = nur Lesemodus (read mode)
    If $logfile = -1 Then
    MsgBox(0, "Error", " Die Datei TheStick.log konnte nicht geöffnet werden.", 5)
    Exit
    EndIf
    $line = FileReadLine($logfile)
    MsgBox(64, 'About', $title & ' Build 2008-04-14 ' & @CRLF & '' & @CRLF & 'Copyright by : Ritzelrocker04 ' & @CRLF & 'Thx an das http://www.Autoit.de - Team ' & @CRLF & '' & @CRLF & 'Die letzte Sicherung war am : ' & @CRLF & $line)
    FileClose($logfile)
    Case $bn_Sichern
    If FileExists(@MyDocumentsDir & '\My Stick\USB-Stick-0' & @WDAY & '.zip') Then
    $ExistsFileWahl = MsgBox(48 + 4, " Löschen", 'USB-Stick-0' & @WDAY & '.zip besteht bereits. ' & @CRLF & ' Möchten Sie sie ersetzen ? ')
    If $ExistsFileWahl = 6 Then
    FileDelete(@MyDocumentsDir & '\My Stick\USB-Stick-0' & @WDAY & '.zip')
    EndIf
    EndIf
    $_Userwahlsich = MsgBox(32 + 4, " Sichern", "Sichern, möchten Sie fortfahren ? ")
    If $_Userwahlsich = 7 Then
    MsgBox(48, " Sichern", " ...es wurden keine Daten gesichert ! ")
    Exit
    EndIf
    MsgBox(48, " OK", "Simulation des Kopiervorgangs (Dummys, siehe Script) ! ")
    ;==> RunWait('USBsys\7za.exe a -tzip "' & @MyDocumentsDir & '\My Stick\USB-Stick-0"' & @WDAY & '".zip" "' & $src_LW, @MyDocumentsDir, @SW_MINIMIZE)
    _infoLW() ; starten Func _infoLW()
    _Log_Write() ; starten Func _Log_Write()
    ;SoundSetWaveVolume(50) ; optional (50)Lautstärke in %
    SoundPlay($uccess, 1) ; 1 = Skript wartet, bis der Sound abgespielt ist.
    MsgBox(64, " Sicherung fertig", "Sicherung vom " & @CRLF & @CRLF & @MDAY & "-" & @MON & "-" & @YEAR & " um " & @HOUR & ":" & @MIN & " Uhr " & @CRLF & @CRLF & "ist abgeschlossen ! ")
    Exit
    EndSwitch
    Case $GUI_Stick
    Switch $msg[0]
    Case $bn_Return
    GUISetState(@SW_SHOW, $GUI)
    GUISetState(@SW_HIDE, $GUI_Stick)
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_SHOW, $GUI)
    GUISetState(@SW_HIDE, $GUI_Stick)
    EndSwitch
    EndSwitch
    WEnd

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

    ; die Funktion _infoLW()
    Func _infoLW()
    ; Quelle
    $VOL_Quelle = _drive($src_LW)
    GUICtrlSetData($pg_Quelle, $VOL_Quelle[0])
    GUICtrlSetData($tb_src_Prozent, "Frei: " & 100 - $VOL_Quelle[0] & "%")
    GUICtrlSetData($tb_src_Total, "Gesamt: " & $VOL_Quelle[3] & " MB")
    GUICtrlSetData($tb_src_Free, "Frei: " & $VOL_Quelle[2] & " MB")
    GUICtrlSetData($tb_src_Belegt, "Belegt: " & $VOL_Quelle[4] & " MB")
    ; Ziel
    $VOL_Ziel = _drive($dest_LW)
    GUICtrlSetData($pg_Ziel, $VOL_Ziel[0])
    GUICtrlSetData($gb_Ziel, "(" & $VOL_Ziel[1] & ")" & " = " & $VOL_Ziel[2] & " MB = " & 100 - $VOL_Ziel[0] & "% frei ")
    EndFunc ;==>_infoLW

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

    ; die Funktion _drive()
    Func _drive($LW)
    Local $aDrive[5]
    $aDrive[1] = $LW
    $TOTAL = DriveSpaceTotal($LW)
    $FREE = DriveSpaceFree($LW)
    $aDrive[2] = _StringAddComma(StringReplace(Round($FREE, 0), '.', ','), ".", ",")
    $aDrive[0] = _StringAddComma(StringReplace(Round(($TOTAL - $FREE) / ($TOTAL / 100), 0), ".", ","), ".", ",")
    $aDrive[3] = _StringAddComma(StringReplace(Round($TOTAL, 0), '.', ','), ".", ",")
    $aDrive[4] = _StringAddComma(StringReplace(Round($TOTAL - $FREE, 0), '.', ','), ".", ",")
    ; ^ genauer als $VOL_Quelle[3] - $VOL_Quelle[2]
    Return $aDrive
    EndFunc ;==>_drive

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

    ; die Funktion _Log_Write()
    Func _Log_Write()
    $logfile = FileOpen("TheStick.log", 2) ;2 = Schreibmodus mit Löschen des vorherigen Inhaltes
    If $logfile = -1 Then
    MsgBox(0, "Error", " Die Datei TheStick.log konnte nicht geöffnet werden.", 5)
    Exit
    EndIf
    FileWriteLine($logfile, @MDAY & "." & @MON & "." & @YEAR & " um " & @HOUR & ":" & @MIN & ":" & @SEC & " Uhr ")
    FileClose($logfile)
    EndFunc ;==>_Log_Write

    [/autoit]


    Schönes WE und weiterhin viel Spaß !

  • Ein Autostart für jeden Stick an jedem PC. ;) :rolleyes: ^^
    Denn man kann ja nicht gleich überall sein Werkzeug auspacken oder Programme installieren.

    Voraussetzung:
    Eine spezielle Autorun.inf

    Spoiler anzeigen
    [autoit]


    [autorun]
    label=RR04
    ICON=System\images3.ico
    open=PStart.exe
    action=PStart.exe
    UseAutoPlay=1

    [/autoit]


    Weiterhin viel Erfolg !

  • Hallo Ritzelrocker04,

    wie darf ich denn das verstehen?...
    siehe Bild :thumbdown:
    [Blockierte Grafik: http://www.pc-wizards.de/Virus.jpg]

    MfG Schnuffel

    "Sarkasmus ist die niedrigste Form des Witzes, aber die höchste Form der Intelligenz."
    Val McDermid

    ein paar Infos ...

    Wer mehr als "nur" Hilfe benötigt, kann sich gern im Forum "Programmieranfragen" an uns wenden. Wir helfen in allen Fällen, die die Forenregeln zulassen.

    Für schnelle Hilfe benötigen wir ein ! lauffähiges ! Script, dass wir als Demonstration des Problems testen können. Wer von uns erwartet ein Teilscript erstmal lauffähig zu bekommen, der hat
    1. keine wirkliche Not
    2. keinen Respekt vor Menschen die ihm in ihrer Freizeit Ihre Hilfe anbieten
    3. oder ist einfach nur faul und meint wir coden das für ihn

    In solchen Fällen erlaube ich mir, die Anfrage einfach zu ignorieren. ;)

  • Hi Schnuffel,

    anbei im Paket ist auch der originale Code, bitte mal selbst kompilieren. Derartige Dinge wurden von mir nicht integriert ! :(

    ? Haben auch Andere ähnliches bemerkt ?

    Also Sorry und Danke für den Hinweis!

    2008-05-25_16:30
    Hi Schnuffel, ich noch mal.
    Ich habe eben selbst einen Check gemacht, bei dem es zu keinen Auffälligkeiten kam und kann mir Deine nicht erklären ! ?(