Jump to content

SWB Temp Clean


 Share

Recommended Posts

ok im making a temp file deleter for SWB... but its all gone wrong...

I want it to be like Diskmax

Where it tell you everything thats going on ...

So it makes a new line and types there not delete everything allready there and then types the new message....

Also it dont delete anything... Why?

Sorry im new to deleteing files with autoit...

heres my code

#include <GUIConstants.au3>
HotKeySet("{esc}", "_exit")

SoundPlay("C:\WINDOWS\Media\Windows XP Startup\")

#Region ### START Koda GUI section ### Form=
$Temp_Clean = GUICreate("Temp_Clean* Powerd by Diskmax", 292, 172, -1, -1, $WS_POPUP, $WS_EX_TOOLWINDOW)
GUISetBkColor(0xD4D0C8)
$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\Windows\Desktop\Ashley's browser\Tempclean packground.bmp", 0, -8, 308, 196, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Do = GUICtrlCreateEdit("", 32, 35, 233, 129, BitOR($ES_AUTOVSCROLL,$ES_READONLY,$ES_WANTRETURN,$WS_BORDER), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
GUICtrlSetFont(-1, 8, 400, 0, "Fixedsys")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xACA899)
GUICtrlSetCursor (-1, 7)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

_Clean()

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

    EndSwitch
WEnd



Func _Clean()
If $Do = GUICtrlSetData($Do, "Welcome to SWB Temp Clean Powered by DiskMax") Then
GUICtrlSetData($Do, "Starting...")
Else
GUICtrlSetData($Do, "Welcome to SWB Temp Clean Powered by DiskMax")
EndIf

_startc()
EndFunc


Func _startc()
$numID = 0
$TnumID = 0
GUICtrlSetData($Do, "Searching... Temp...")
Sleep(2000)
$Temp_Dir = @HomeDrive & "\Temp\"
$Temp_File = "*.*"
$Del_Dir = "go"
$Temp_Dir = @HomeDrive & "\Temp\"
$Temp_File = "*.*"
$Del_Dir = "go"
$Temp_Dir = @UserProfileDir & "\Local Settings\Temp\"
$Temp_File = "*.*"
$Del_Dir = "go"
GUICtrlSetData($Do, "Searching... Cookies")
Sleep(2000)
$Temp_Dir = @UserProfileDir & "\Cookies\"
$Temp_File = "*.*"
$Del_Dir = "go"
GUICtrlSetData($Do, "Searching... MostRecent...")
Sleep(2000)
$Temp_Dir = @UserProfileDir & "\Recent\"
$Temp_File = "*.*"
$Del_Dir = "go"
$Temp_Dir = @UserProfileDir & "\Application Data\Microsoft\office\recent\"
$Temp_File = "*.*"
$Del_Dir = "go"
$Del_IFile = "\*.*"
$Del_IFile = ""

GUICtrlSetData($Do, " Searching - Empty Temporary Internet Folders ...Please wait... ")
Sleep(2000)
$Temp_Dir = @UserProfileDir & "\Local Settings\Temporary Internet Files\Content.IE5\"
$Temp_File = "*.*"
$Del_Dir = "go"
GUICtrlSetData($Do, " Files Deleted: " & $numID)
Sleep(5000)
GUICtrlSetData($Do, "")
Sleep(1500)
GUICtrlSetData($Do, "Finished SWB Temp Clean! " & "Total Files Deleted:" &$numID)
Sleep(5000)
Exit
EndFunc



Func _exit()
    SoundPlay("C:\WINDOWS\Media\Windows XP Shutdown\")
    Exit
EndFunc

i got most of this from Xpclean

Is there a better way cus this just dont work....

Link to comment
Share on other sites

The script was badly structured, also i didn't like the coloring so i fixed up a bit, i think this is what you wanted to do.

Change FileDelete to FileRecycle if you are testing and for safety issue, anyways i don't see any point of making a web browser off IE funcs, the security issue will be bad and nobody will use it, like pop-ups, javascript expliots, cookies, many more..

The version is almost the limit..anyways..

#NoTrayIcon
#include <GUIConstants.au3>

SoundPlay(@WindowsDir & "\media\Windows Startup.wav")

$Temp_Clean = GUICreate("Temp_Clean* Powerd by Diskmax", 292, 172, -1, -1, $WS_POPUP, $WS_EX_TOOLWINDOW)
$Do = GUICtrlCreateEdit("", 32, 35, 233, 129, BitOR($ES_AUTOVSCROLL, $ES_READONLY, $ES_WANTRETURN, $WS_BORDER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE))
GUICtrlSetFont(-1, 8, 400, 0, "Fixedsys")
GUISetState()

_StartDelete()

While 1
    $nMsg = GUIGetMsg()
    If $nMsg=-3 Then Exit
WEnd

Func _StartDelete()
    $Counter=0
    GUICtrlSetData($Do, "Searching... Local Temp...")
    Do
        FileDelete(@UserProfileDir & "\Local Settings\Temp\*.*")
        $Counter+=1
    Until FileDelete(@UserProfileDir & "\Local Settings\Temp\*.*")=0
    $Counter-=1
    GUICtrlSetData($Do, "Searching... Cookies")
    Do
        FileDelete(@UserProfileDir & "\Cookies\*.*")
        $Counter+=1
    Until FileDelete(@UserProfileDir & "\Cookies\*.*")=0
    $Counter-=1
    GUICtrlSetData($Do, " Searching - Empty Temporary Internet Folders ...Please wait... ")
    Do
        FileDelete(@UserProfileDir & "\Local Settings\Temporary Internet Files\Content.IE5\*.*")
        $Counter+=1
    Until FileDelete(@UserProfileDir & "\Local Settings\Temporary Internet Files\Content.IE5\*.*")=0
    $Counter-=1
    GUICtrlSetData($Do, " Files Deleted: " & $Counter)
    Sleep(5000)
    GUICtrlSetData($Do, "")
    Sleep(1500)
    GUICtrlSetData($Do, "Finished SWB Temp Clean! " & "Total Files Deleted:" &$Counter)
    Sleep(5000)
    _Exit()
EndFunc
Func _Exit()
    SoundPlay(@WindowsDir&"\Media\WindowsXP Shutdown.wav",1)
    Exit
EndFunc
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...