cmd

  • Hey, und zwar habe ich mir überlegt ein kleines Programm zu schreiben, welches hilft, Dateien zu löschen. Hier mein Script:

    Spoiler anzeigen
    [autoit]


    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

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

    Dim $Zahler1
    Dim $Zahler2
    Dim $Zahler3
    Dim $Zahler4
    Dim $Zahler5
    Dim $Zahler6
    Dim $Zahler7
    Dim $Zahler8
    Dim $Zahler9
    Dim $Zahler10

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

    #Region ### START Koda GUI section ### Form=C:\Users\User\Desktop\Simple Cleaner.kxf
    $SimpleCleaner = GUICreate("Simple Cleaner", 390, 493, 275, 166)
    GUISetIcon("S-ico.ico")
    $Checkbox1 = GUICtrlCreateCheckbox("Coockies löschen", 46, 48, 297, 33)
    $Checkbox2 = GUICtrlCreateCheckbox("Lokale Verlauf löschen", 46, 80, 297, 33)
    $Checkbox3 = GUICtrlCreateCheckbox("Temporare Internet Dateien löschen", 46, 112, 297, 33)
    $Checkbox4 = GUICtrlCreateCheckbox("Temp- Ordner leeren", 46, 144, 297, 33)
    $Checkbox5 = GUICtrlCreateCheckbox("Recent- Ordner leeren", 46, 176, 297, 33)
    $Checkbox6 = GUICtrlCreateCheckbox("Microsoft Office Dateien Löschen", 46, 208, 297, 33)
    $Checkbox7 = GUICtrlCreateCheckbox("Installation Informationen", 46, 240, 297, 33)
    $Checkbox8 = GUICtrlCreateCheckbox("Windows Temp- Ordner leeren", 46, 272, 297, 33)
    $Checkbox9 = GUICtrlCreateCheckbox("--- NOCH NICHT BELEGT ---", 46, 304, 297, 33)
    $Button1 = GUICtrlCreateButton("Markiertes Löschen", 134, 352, 121, 25, $WS_GROUP)
    $Progress1 = GUICtrlCreateProgress(26, 440, 337, 33)
    $Label1 = GUICtrlCreateLabel("Simple Cleaner", 119, 16, 151, 33)
    GUICtrlSetFont(-1, 18, 800, 2, "Script MT Bold")
    $Label2 = GUICtrlCreateLabel("Bitte zu löschende Dateien auswählen.", 23, 408, 343, 17)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    if bitand(guictrlread($checkbox1),$GUI_CHECKED) then
    _RunDOS("RD /s /q C:\Dokumente und Einstellungen\administrator\Cookies")
    GUICtrlSetData ( $Label2, "Coockies löschen" )
    ProgressSet (10)
    else
    endif

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

    if bitand(guictrlread($checkbox2),$GUI_CHECKED) then
    _RunDOS("RD /s /q C:\Dokumente und Einstellungen\administrator\Lokale Einstellungen\Verlauf")
    GUICtrlSetData ( $Label2, "Lokale Verlauf löschen" )
    ProgressSet (20)
    else
    endif

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

    if bitand(guictrlread($checkbox3),$GUI_CHECKED) then
    _RunDOS("RD /s /q C:\Dokumente und Einstellungen\administrator\Lokale Einstellungen\Temporary Internet Files")
    GUICtrlSetData ( $Label2, "Temporare Internet Dateien löschen" )
    ProgressSet (30)
    else
    endif

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

    if bitand(guictrlread($checkbox4),$GUI_CHECKED) then
    _RunDOS("RD /s /q C:\Dokumente und Einstellungen\administrator\Lokale Einstellungen\Temp")
    GUICtrlSetData ( $Label2, "Temp- Ordner leeren" )
    ProgressSet (40)
    else
    endif

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

    if bitand(guictrlread($checkbox5),$GUI_CHECKED) then
    _RunDOS("RD /s /q C:\Dokumente und Einstellungen\administrator\Recent")
    GUICtrlSetData ( $Label2, "Recent- Ordner leeren" )
    ProgressSet (50)
    else
    endif

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

    if bitand(guictrlread($checkbox6),$GUI_CHECKED) then
    _RunDOS("RD /s /q C:\Dokumente und Einstellungen\administrator\Anwendungsdaten\Microsoft\Office\Zuletzt verwendet")
    GUICtrlSetData ( $Label2, "Microsoft Office Dateien Löschen" )
    ProgressSet (60)
    else
    endif

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

    if bitand(guictrlread($checkbox7),$GUI_CHECKED) then
    _RunDOS("RD /s /q C:\Programme\InstallShield Installation Information")
    GUICtrlSetData ( $Label2, "Installation Informationen" )
    ProgressSet (70)
    else
    endif

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

    if bitand(guictrlread($checkbox8),$GUI_CHECKED) then
    _RunDOS("RD /s /q C:\Windows\Temp")
    GUICtrlSetData ( $Label2, "Windows Temp- Ordner leeren" )
    ProgressSet (80)
    else
    endif

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

    if bitand(guictrlread($checkbox9),$GUI_CHECKED) then
    _RunDOS("BEFEHL");
    ;~ GUICtrlSetData ( $Label2, "Coockies löschen" )
    ProgressSet (90)
    ProgressSet (100)
    else
    endif

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

    if bitand(guictrlread($checkbox1),$GUI_UNCHECKED) then $Zahler1 = 1
    if bitand(guictrlread($checkbox2),$GUI_UNCHECKED) then $Zahler2 = 1
    if bitand(guictrlread($checkbox3),$GUI_UNCHECKED) then $Zahler3 = 1
    if bitand(guictrlread($checkbox4),$GUI_UNCHECKED) then $Zahler4 = 1
    if bitand(guictrlread($checkbox5),$GUI_UNCHECKED) then $Zahler5 = 1
    if bitand(guictrlread($checkbox6),$GUI_UNCHECKED) then $Zahler6 = 1
    if bitand(guictrlread($checkbox7),$GUI_UNCHECKED) then $Zahler7 = 1
    if bitand(guictrlread($checkbox8),$GUI_UNCHECKED) then $Zahler8 = 1
    if bitand(guictrlread($checkbox9),$GUI_UNCHECKED) then $Zahler9 = 1
    $Zahler10 = $Zahler1 + $Zahler2 + $Zahler3 + $Zahler4 + $Zahler5 + $Zahler6 + $Zahler7 + $Zahler8 + $Zahler9

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

    if $Zahler10 = 9 then GUICtrlSetData ( $Label2, "ES MUSS MINDESTENS EINE OPTION ANGEKLICKT SEIN" )

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

    EndSwitch
    WEnd
    WEnd

    [/autoit]

    Ich bekomme einen Error zurück. Hat das damit zu tun, das ich den Dos befehl falsch formuliert habe, oder das es ihn unter win7 nicht gibt. Ich habe die befehle in eine Bat datei auf einem xp rechner versucht. Und er hat erfolgreich alles gelöscht. Nun wollte ich es eben etwas schöner gestalten.

    mfg Tim

  • Ich glaube der Wurm ist beispielsweise das hier:

    [autoit]

    _RunDOS("RD /s /q C:\Dokumente und Einstellungen\administrator\Cookies")

    [/autoit]

    Müsste es nicht so lauten?:

    [autoit]

    _RunDOS (RD /s /q "C:\Dokumente und Einstellungen\administrator\Cookies")

    [/autoit]


    Kann mich allerdings irren. Wieso machst du das nicht per externem Batch über CMD?

    Und nach einem If = Then muss kein Else kommen, ist mir neu. Dann mach ich immer EndIf rein. Also muss else raus, da kein Folgebefehl folgt.

    Einmal editiert, zuletzt von Sentionline (25. Juli 2010 um 00:15)

  • Einfach wäre es, wenn du statt CMD die Funktionen FileDelete bzw. DirRemove verwendest. Beides sind native AutoIt funktionen und sicher kompatibler als mit CMD zu arbeiten ;)

    Ich möchte aber eben diesen Ordner leeren, ohne Ihn selber zu löschen. Und ich weis ja nicht was drinnen ist. Ach und wenn die datei nciht gelöscht werden kann. Weil sie z.B. gerade verwendet wird, dann soll sie einfach übersprungen werden.

    mfg Tim

    Wenn du FileDelete() einen Ordnerpfad übergibst werden alle Dateien in diesem Ordner gelöscht. Dateien die nicht gelöscht werden können, werden soweit ich weiss übersprungen.

  • Ok, habe das nun mit File Delete gelöst. Nun möchte cih aber auch noch alle unterordner die sich im angegebenem Ordner befinden löschen. Ist dies mit File Delete möglich, oder brauche ich da eine andere Funktion ?

    mfg Tim

    Habe nun mit FileRemove gearbeitet, aber es werden immer noch Ordner in dem Angegebenem Ordner stehen gelasssen.

    Ach, hier mein Momentanes Script:

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

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

    Dim $Zahler1 = 0
    Dim $Zahler2 = 0
    Dim $Zahler3 = 0
    Dim $Zahler4 = 0
    Dim $Zahler5 = 0
    Dim $Zahler6 = 0
    Dim $Zahler7 = 0
    Dim $Zahler8 = 0
    Dim $Zahler9 = 0
    Dim $Zahler10 = 0

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

    #Region ### START Koda GUI section ### Form=C:\Users\User\Desktop\Simple Cleaner.kxf
    $SimpleCleaner = GUICreate("Simple Cleaner", 390, 493, 275, 166)
    GUISetIcon("S-ico.ico")
    $Checkbox1 = GUICtrlCreateCheckbox("Coockies löschen", 46, 48, 297, 33)
    $Checkbox2 = GUICtrlCreateCheckbox("Lokale Verlauf löschen", 46, 80, 297, 33)
    $Checkbox3 = GUICtrlCreateCheckbox("Temporare Internet Dateien löschen", 46, 112, 297, 33)
    $Checkbox4 = GUICtrlCreateCheckbox("Temp- Ordner leeren", 46, 144, 297, 33)
    $Checkbox5 = GUICtrlCreateCheckbox("Recent- Ordner leeren", 46, 176, 297, 33)
    $Checkbox6 = GUICtrlCreateCheckbox("Microsoft Office Dateien Löschen", 46, 208, 297, 33)
    $Checkbox7 = GUICtrlCreateCheckbox("Installation Informationen", 46, 240, 297, 33)
    $Checkbox8 = GUICtrlCreateCheckbox("Windows Temp- Ordner leeren", 46, 272, 297, 33)
    $Checkbox9 = GUICtrlCreateCheckbox("--- NOCH NICHT BELEGT ---", 46, 304, 297, 33)
    $Button1 = GUICtrlCreateButton("Markiertes Löschen", 134, 352, 121, 25, $WS_GROUP)
    $Progress1 = GUICtrlCreateProgress(26, 440, 337, 33)
    $Label1 = GUICtrlCreateLabel("Simple Cleaner", 119, 16, 151, 33)
    GUICtrlSetFont(-1, 18, 800, 2, "Script MT Bold")
    $Label2 = GUICtrlCreateLabel("Bitte zu löschende Dateien auswählen.", 23, 408, 343, 17)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    if bitand(guictrlread($checkbox1),$GUI_CHECKED) then
    GUICtrlSetData ( $Label2, "Coockies löschen" )
    DirRemove("C:\Dokumente und Einstellungen\administrator\Cookies",1)
    GUICtrlSetData ( $Label2, "OK..." )
    GUICtrlSetData ( $Progress1, 10 )
    endif

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

    if bitand(guictrlread($checkbox2),$GUI_CHECKED) then
    GUICtrlSetData ( $Label2, "Lokale Verlauf löschen" )
    DirRemove("C:\Dokumente und Einstellungen\administrator\Lokale Einstellungen\Verlauf",1)
    GUICtrlSetData ( $Label2, "OK..." )
    GUICtrlSetData ( $Progress1, 20 )
    endif

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

    if bitand(guictrlread($checkbox3),$GUI_CHECKED) then
    GUICtrlSetData ( $Label2, "Temporare Internet Dateien löschen" )
    DirRemove("C:\Dokumente und Einstellungen\administrator\Lokale Einstellungen\Temporary Internet Files",1)
    GUICtrlSetData ( $Label2, "OK..." )
    GUICtrlSetData ( $Progress1, 30 )
    endif

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

    if bitand(guictrlread($checkbox4),$GUI_CHECKED) then
    GUICtrlSetData ( $Label2, "Temp- Ordner leeren" )
    DirRemove("C:\Dokumente und Einstellungen\administrator\Lokale Einstellungen\Temp",1)
    GUICtrlSetData ( $Label2, "OK..." )
    GUICtrlSetData ( $Progress1, 40 )
    endif

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

    if bitand(guictrlread($checkbox5),$GUI_CHECKED) then
    GUICtrlSetData ( $Label2, "Recent- Ordner leeren" )
    DirRemove("C:\Dokumente und Einstellungen\administrator\Recent",1)
    GUICtrlSetData ( $Label2, "OK..." )
    GUICtrlSetData ( $Progress1, 50 )
    endif

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

    if bitand(guictrlread($checkbox6),$GUI_CHECKED) then
    GUICtrlSetData ( $Label2, "Microsoft Office Dateien Löschen" )
    DirRemove("C:\Dokumente und Einstellungen\administrator\Anwendungsdaten\Microsoft\Office\Zuletzt verwendet",1)
    GUICtrlSetData ( $Label2, "OK..." )
    GUICtrlSetData ( $Progress1, 60 )
    endif

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

    if bitand(guictrlread($checkbox7),$GUI_CHECKED) then
    GUICtrlSetData ( $Label2, "Installation Informationen" )
    DirRemove("C:\Programme\InstallShield Installation Information",1)
    GUICtrlSetData ( $Label2, "OK..." )
    GUICtrlSetData ( $Progress1, 70 )
    endif

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

    if bitand(guictrlread($checkbox8),$GUI_CHECKED) then
    GUICtrlSetData ( $Label2, "Windows Temp- Ordner leeren",1)
    DirRemove("C:\Windows\Temp",1)
    GUICtrlSetData ( $Label2, "OK..." )
    GUICtrlSetData ( $Progress1, 80 )
    endif

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

    ;~ if bitand(guictrlread($checkbox9),$GUI_CHECKED) then
    ;~ _RunDOS("BEFEHL")
    ;~ GUICtrlSetData ( $Label2, "Coockies löschen" )
    ;~ GUICtrlSetData ( $Progress1, 90 )
    ;~ else
    ;~ endif

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

    GUICtrlSetData ( $Progress1, 100 )

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

    if bitand(guictrlread($checkbox1),$GUI_UNCHECKED) then $Zahler1 = 1
    if bitand(guictrlread($checkbox2),$GUI_UNCHECKED) then $Zahler2 = 1
    if bitand(guictrlread($checkbox3),$GUI_UNCHECKED) then $Zahler3 = 1
    if bitand(guictrlread($checkbox4),$GUI_UNCHECKED) then $Zahler4 = 1
    if bitand(guictrlread($checkbox5),$GUI_UNCHECKED) then $Zahler5 = 1
    if bitand(guictrlread($checkbox6),$GUI_UNCHECKED) then $Zahler6 = 1
    if bitand(guictrlread($checkbox7),$GUI_UNCHECKED) then $Zahler7 = 1
    if bitand(guictrlread($checkbox8),$GUI_UNCHECKED) then $Zahler8 = 1
    ;~ if bitand(guictrlread($checkbox9),$GUI_UNCHECKED) then $Zahler9 = 1
    $Zahler10 = $Zahler1 + $Zahler2 + $Zahler3 + $Zahler4 + $Zahler5 + $Zahler6 + $Zahler7 + $Zahler8 + $Zahler9

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

    if $Zahler10 = 8 then ;Nur weil 8 Checkboxen zur verfügung stehen sonnt eben 9 oder co.
    GUICtrlSetData ( $Label2, "ES MUSS MINDESTENS EINE OPTION ANGEKLICKT SEIN" )
    GUICtrlSetData ( $Progress1, 0 )
    EndIf

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

    EndSwitch
    WEnd

    [/autoit]

    PS: Ach und wenn cih einmal etwas anhake, und dann auf löschen drücke, wird das gelöscht. Und dann wenn cih erneut löschen will, geht es nciht mehr. Ich muss das Script erst erneut öffnen, das es geht.

    Woran liegt es ?

    lg Tim

  • Hier noch etwas, das man löschen sollte.

    Schau mal in der DOS-BOX die Ausgabe des folgenden Befehls an:

    Spoiler anzeigen
    [autoit]


    ipconfig /displaydns

    [/autoit]

    Um dieses zu löschen gibt man dann folgendes ein:

    Spoiler anzeigen
    [autoit]


    ipconfig /flushdns

    [/autoit]

    Lieben Gruß,
    Alina

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Geheime Information: ;)
    OuBVU5ebLhHu5QvlnAyQB4A7SzBrvWulwL7RLl2BdH5tI6sIYspeMKeXMSXl

  • Hey, danke dir. Super nun ist das auch mit eingebunden. Hat noch jemand zufällig etwas was man nicht mehr auf dem PC braucht.

    Dann her damit ;)

    Das Programm funktioniert soweit super !! Hat noch jemand eine Idee, wie ich es schaffe, den Pfad zu kürzen ?

    Also stadt so: C:\Dokumente und Einstellungen\administrator\Cookies
    z.B. C:\*\Cookies <-- Also das sich der PC dabei auf der Platte C den Ordner Cookies vornimmt ;)

    lg Tim

  • Spoiler anzeigen
    [autoit]

    @UserProfileDir & "\Cookies"

    [/autoit]

    @UserProfileDir = Pfad zum Profil-Ordner des aktuellen Benutzers (entspricht der Systemvariable %USERPROFILE%).

    Sollte das helfen?

    Frage mich gerade, ob man wirklich immer nur in diesen Ordner krümelt. Ich meine das es auch andere Ordner gibt, wo man Krümel findet, oder?

    Lieben Gruß,
    Alina

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Geheime Information: ;)
    OuBVU5ebLhHu5QvlnAyQB4A7SzBrvWulwL7RLl2BdH5tI6sIYspeMKeXMSXl

  • Danke dir. Ähm, wie meinst du das ? Also alle dateien vom Typ mp3. Oder wie meinst du das ?

    So kann der benutzer ja wählen, was er löschen will. Cookies, Temp,... oder sowas.


    mfg Tim


    OK, noch mal zu diesem hier komment:

    @UserProfileDir & "\Cookies"


    Das Problem ist, bei dem Pfad:
    "C:\Windows\Temp" geht das nicht, weil es ja nich in der Juser ist. Gibt es dafür auch was ?

    lg Tim

  • Mit @UserProfileDir (Makros) Subroutinen (Func) und for (Schleifen) würdest du den Code sehr verkürzen ;)


    [autoit]


    _Delete($Checkbox1, 'Coockies löschen', @UserProfileDir & '\Cookies')

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

    Func _Delete($checkbox, $deletetext, $delete_path)
    If BitAND(GUICtrlRead($checkbox), $GUI_CHECKED) Then
    GUICtrlSetData($Label2, $deletetext)
    DirRemove($delete_path", 1)
    GUICtrlSetData($Label2, "OK...")
    GUICtrlSetData($Progress1, 10)
    EndIf
    EndFunc

    [/autoit]

    ----------------------------------------------------------------------------------------------------------------------
    Früher musste man Drachen töten und konnte die Jungfrau heiraten.
    Heute gibt es keine Jungfrauen mehr, man muss den Drachen heiraten!

  • Ich hoffe du kannst mir helfen:
    Oder habe ich dich falsch verstanden.

    Hier mein Aktueller Code :

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Process.au3> ; Für die _RunDOS
    #include <EditConstants.au3> ; Für die EditBox in Hilfe

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

    Dim $Zahler1 = 0
    Dim $Zahler2 = 0
    Dim $Zahler3 = 0
    Dim $Zahler4 = 0
    Dim $Zahler5 = 0
    Dim $Zahler6 = 0
    Dim $Zahler7 = 0
    Dim $Zahler8 = 0
    Dim $Zahler9 = 0
    Dim $Zahler10 = 0

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

    #Region ### START Koda GUI section ### Form=C:\Users\User\Desktop\Simple Cleaner.kxf
    $SimpleCleaner = GUICreate("Simple Cleaner", 390, 515, 275, 166)
    GUISetIcon("S-ico.ico")
    $Fragezeichen = GUICtrlCreateMenu("?")
    $Hilfe = GUICtrlCreateMenuItem("Hilfe", $Fragezeichen)
    $Uber = GUICtrlCreateMenuItem("Über", $Fragezeichen)
    $Checkbox1 = GUICtrlCreateCheckbox("Coockies löschen", 46, 48, 297, 33)
    $Checkbox2 = GUICtrlCreateCheckbox("Lokale Verlauf löschen", 46, 80, 297, 33)
    $Checkbox3 = GUICtrlCreateCheckbox("Temporare Internet Dateien löschen", 46, 112, 297, 33)
    $Checkbox4 = GUICtrlCreateCheckbox("Temp- Ordner leeren", 46, 144, 297, 33)
    $Checkbox5 = GUICtrlCreateCheckbox("Recent- Ordner leeren", 46, 176, 297, 33)
    $Checkbox6 = GUICtrlCreateCheckbox("Microsoft Office Dateien Löschen", 46, 208, 297, 33)
    $Checkbox7 = GUICtrlCreateCheckbox("Installation Informationen", 46, 240, 297, 33)
    $Checkbox8 = GUICtrlCreateCheckbox("Windows Temp- Ordner leeren", 46, 272, 297, 33)
    $Checkbox9 = GUICtrlCreateCheckbox("IP- FlushDNS", 46, 304, 297, 33)
    $ML = GUICtrlCreateButton("Markiertes Löschen", 134, 352, 121, 25, $WS_GROUP)
    $Progress1 = GUICtrlCreateProgress(26, 440, 337, 33)
    $Label1 = GUICtrlCreateLabel("Simple Cleaner", 119, 16, 151, 33)
    GUICtrlSetFont(-1, 18, 800, 2, "Script MT Bold")
    $Label2 = GUICtrlCreateLabel("Bitte zu löschende Dateien auswählen.", 23, 408, 343, 17)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    Case $Hilfe
    #Region ### START Koda GUI section ### Form=C:\Users\User\Desktop\Simple Cleaoner\Hilfe.kxf
    $HilfeForm = GUICreate("Hilfe", 413, 304, 302, 218)
    GUISetIcon("S-ico.ico")
    $GroupH1 = GUICtrlCreateGroup("Hilfe zu Simple Cleaner", 14, 15, 385, 265)
    $EditH1 = GUICtrlCreateEdit("", 22, 36, 369, 233, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
    GUICtrlSetData(-1, "Mit Simple Cleaner, ist es Möglich überflüssige Systemdateien einfach und restlos zu entfernen. "&@crlf&""&@crlf&"Was Sie löschen möchten, entscheiden Sie! "&@crlf&"Sie markieren einfach was Sie löschen möchten, und drücken dann auf "&@crlf&""&@crlf&"-Markiertes Löschen-."&@crlf&""&@crlf&" Nun warten Sie einfach ab, bis alles erfolgreich gelöscht worden ist. "&@crlf&"Das Programm kann nun geschlossen werden.")
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    GUIDelete ($HilfeForm)
    ExitLoop

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

    EndSwitch
    WEnd

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

    Case $Uber
    #Region ### START Koda GUI section ### Form=C:\Users\User\Desktop\Simple Cleaoner\Über.kxf
    $UberForm = GUICreate("Über", 324, 240, 302, 218)
    GUISetIcon("S-ico.ico")
    $picU1 = GUICtrlCreatePic("pic1.jpg", 16, 24, 105, 97, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    $GroupBox1 = GUICtrlCreateGroup("", 8, 8, 305, 185)
    $LabelU1 = GUICtrlCreateLabel("Simple Cleaner", 152, 24, 133, 28, $WS_GROUP)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    $LabelU2 = GUICtrlCreateLabel("1.0", 152, 56, 26, 24, $WS_GROUP)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $LabelU4 = GUICtrlCreateLabel("Comments: Build Juli 2010", 16, 160, 127, 17, $WS_GROUP)
    $LabelU3 = GUICtrlCreateLabel("Copyright by Tim Erler", 16, 136, 106, 17, $WS_GROUP)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $OK = GUICtrlCreateButton("&OK", 112, 208, 75, 25)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    GUIDelete ($UberForm)
    ExitLoop

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

    Case $OK
    GUIDelete ($UberForm)
    ExitLoop
    EndSwitch
    WEnd

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

    Case $ML
    if bitand(guictrlread($checkbox1),$GUI_CHECKED) then
    DirRemove(@UserProfileDir & "\Cookies",1)
    GUICtrlSetData ( $Label2, "Coockies gelöscht" )
    GUICtrlSetData ( $Progress1, 10 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox2),$GUI_CHECKED) then
    DirRemove(@UserProfileDir & "\Lokale Einstellungen\Verlauf",1)
    GUICtrlSetData ( $Label2, "Lokale Verlauf gelöscht" )
    GUICtrlSetData ( $Progress1, 20 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox3),$GUI_CHECKED) then
    DirRemove(@UserProfileDir & "\Lokale Einstellungen\Temporary Internet Files",1)
    GUICtrlSetData ( $Label2, "Temporare Internet Dateien gelöscht" )
    GUICtrlSetData ( $Progress1, 30 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox4),$GUI_CHECKED) then
    DirRemove(@UserProfileDir & "\Lokale Einstellungen\Temp",1)
    GUICtrlSetData ( $Label2, "Temp- Ordner gelehrt" )
    GUICtrlSetData ( $Progress1, 40 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox5),$GUI_CHECKED) then
    DirRemove(@UserProfileDir & "\Recent",1)
    GUICtrlSetData ( $Label2, "Recent- Ordner gelehrt" )
    GUICtrlSetData ( $Progress1, 50 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox6),$GUI_CHECKED) then
    DirRemove(@UserProfileDir & "\Anwendungsdaten\Microsoft\Office\Zuletzt verwendet",1)
    GUICtrlSetData ( $Label2, "Microsoft Office Dateien gelöscht" )
    GUICtrlSetData ( $Progress1, 60 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox7),$GUI_CHECKED) then
    DirRemove("C:\Programme\InstallShield Installation Information",1)
    GUICtrlSetData ( $Label2, "Installation Informationen gelöscht" )
    GUICtrlSetData ( $Progress1, 70 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox8),$GUI_CHECKED) then
    DirRemove(@WindowsDir & "\Temp",1)
    GUICtrlSetData ( $Label2, "Windows Temp- Ordner gelehrt",1)
    GUICtrlSetData ( $Progress1, 80 )
    Sleep(500)
    endif

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

    if bitand(guictrlread($checkbox9),$GUI_CHECKED) then
    _RunDOS("ipconfig /flushdns")
    GUICtrlSetData ( $Label2, "IP-DNS gelöscht" )
    GUICtrlSetData ( $Progress1, 90 )
    Sleep(500)
    else
    endif

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

    GUICtrlSetData ( $Progress1, 100 )
    GUICtrlSetData ( $Label2, " FERTIG..." )

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

    if bitand(guictrlread($checkbox1),$GUI_UNCHECKED) then $Zahler1 = 1
    if bitand(guictrlread($checkbox2),$GUI_UNCHECKED) then $Zahler2 = 1
    if bitand(guictrlread($checkbox3),$GUI_UNCHECKED) then $Zahler3 = 1
    if bitand(guictrlread($checkbox4),$GUI_UNCHECKED) then $Zahler4 = 1
    if bitand(guictrlread($checkbox5),$GUI_UNCHECKED) then $Zahler5 = 1
    if bitand(guictrlread($checkbox6),$GUI_UNCHECKED) then $Zahler6 = 1
    if bitand(guictrlread($checkbox7),$GUI_UNCHECKED) then $Zahler7 = 1
    if bitand(guictrlread($checkbox8),$GUI_UNCHECKED) then $Zahler8 = 1
    if bitand(guictrlread($checkbox9),$GUI_UNCHECKED) then $Zahler9 = 1
    $Zahler10 = $Zahler1 + $Zahler2 + $Zahler3 + $Zahler4 + $Zahler5 + $Zahler6 + $Zahler7 + $Zahler8 + $Zahler9

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

    if $Zahler10 = 9 then ;Nur weil 9 Checkboxen zur verfügung stehen sonnt eben 9 oder co. --- Nun 9 mit der dns
    GUICtrlSetData ( $Label2, "ES MUSS MINDESTENS EINE OPTION ANGEKLICKT SEIN" )
    GUICtrlSetData ( $Progress1, 0 )
    EndIf

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

    Dim $Zahler1 = 0; Variablen wieder auf 0 Setzen
    Dim $Zahler2 = 0
    Dim $Zahler3 = 0
    Dim $Zahler4 = 0
    Dim $Zahler5 = 0
    Dim $Zahler6 = 0
    Dim $Zahler7 = 0
    Dim $Zahler8 = 0
    Dim $Zahler9 = 0
    Dim $Zahler10 = 0

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

    EndSwitch
    WEnd

    [/autoit]

    PS: Ich muss erlich sagen, ich habe eigentlich nochnie Func genutzt. Habe davon keine Ahnung. Ich weis klingt blöd, aber habe es immer so gelöst wie mein Script zeigt :)


    EDIT5: Habe Ich die Möglichkeit mir die Größe eines Ordner, also z.B. vom Temp Ordner anzeigen zu lassen --> In eine Variable speichern. Ich habe gesucht und
    FileGetSize() gefunden. Ich habe das Problem, das dies nur mit einer Datei geht, und nicht mit einem Ordner. Was kann cih da machen ?

    lg Tim