#Region AutoIt3Wrapper 预编译参数(常用参数)
#AutoIt3Wrapper_Icon= ;图标,支持EXE,DLL,ICO
#AutoIt3Wrapper_OutFile= ;输出文件名
#AutoIt3Wrapper_OutFile_Type=exe ;文件类型
#AutoIt3Wrapper_Compression=4 ;压缩等级
#AutoIt3Wrapper_UseUpx=y ;使用压缩
#AutoIt3Wrapper_Res_Comment= ;注释
#AutoIt3Wrapper_Res_Description= ;详细信息
#AutoIt3Wrapper_Res_Fileversion=3.3.6.2
#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=p ;自动更新版本
#AutoIt3Wrapper_Res_LegalCopyright= ;版权
#AutoIt3Wrapper_Change2CUI=N ;修改输出的程序为CUI(控制台程序)
;#AutoIt3Wrapper_Res_Field=AutoIt Version|%AutoItVer% ;自定义资源段
;#AutoIt3Wrapper_Run_Tidy= ;脚本整理
;#AutoIt3Wrapper_Run_Obfuscator= ;代码迷惑
;#AutoIt3Wrapper_Run_AU3Check= ;语法检查
;#AutoIt3Wrapper_Run_Before= ;运行前
;#AutoIt3Wrapper_Run_After= ;运行后
#EndRegion AutoIt3Wrapper 预编译参数设置完成
#include <GUIConstantsEx.au3>
#include <buttonconstants.au3>
#include <WindowsConstants.au3>
#cs ____________________________________
Au3 版本:
脚本作者:
Email:
QQ/TM:
脚本版本:
脚本功能:
#ce _______________脚本开始_________________
;
Global $Title = "系统清理工具"
If WinExists($Title) Then Exit
AutoItWinSetTitle($Title)
Global $Form = GUICreate($Title, 440, 450, -1, -1)
Global $SkinFile = @TempDir & '\Skin.skf', _
$SkinDll = @TempDir & '\SkinCrafter.dll'
FileInstall('include\Skin.skf', $SkinFile, 1)
FileInstall('include\SkinCrafter.dll', $SkinDll, 1)
Global $hSkinDll = _LoadSkin($SkinFile, $SkinDll, $Form)
GUISetState(@SW_SHOW)
Global $hSkinDll = _LoadSkin($SkinFile, $SkinDll, $Form)
Dim $Checkbox[21]
$Group1 = GUICtrlCreateGroup("选择", 10, 12, 140, 46, $BS_RIGHTBUTTON)
$Button1 = GUICtrlCreateButton("全选", 60, 24, 64, 25)
$Group2 = GUICtrlCreateGroup("清理IE浏览记录", 10, 70, 420, 70)
$Checkbox[1] = GUICtrlCreateCheckbox("Internet临时文件", 14, 90, 110, 20, $BS_RIGHTBUTTON)
$Checkbox[2] = GUICtrlCreateCheckbox("Cookie", 212, 90, 52, 20, $BS_RIGHTBUTTON)
$Checkbox[3] = GUICtrlCreateCheckbox("历史记录", 352, 90, 64, 20, $BS_RIGHTBUTTON)
$Checkbox[4] = GUICtrlCreateCheckbox("表单", 84, 110, 40, 20, $BS_RIGHTBUTTON)
$Checkbox[5] = GUICtrlCreateCheckbox("密码", 224, 110, 40, 20, $BS_RIGHTBUTTON)
$Checkbox[6] = GUICtrlCreateCheckbox("加载存储的文件和设置", 280, 110, 136, 20, $BS_RIGHTBUTTON)
$Group3 = GUICtrlCreateGroup("清理系统垃圾文件", 10, 152, 420, 88)
$Checkbox[7] = GUICtrlCreateCheckbox("最近使用的文档", 24, 172, 100, 20, $BS_RIGHTBUTTON)
$Checkbox[8] = GUICtrlCreateCheckbox("用户临时目录", 176, 172, 88, 20, $BS_RIGHTBUTTON)
$Checkbox[9] = GUICtrlCreateCheckbox("系统临时目录", 328, 172, 88, 20, $BS_RIGHTBUTTON)
$Checkbox[10] = GUICtrlCreateCheckbox("下载的补丁文件", 24, 192, 100, 20, $BS_RIGHTBUTTON)
$Checkbox[11] = GUICtrlCreateCheckbox("预读取文件夹", 176, 192, 88, 20, $BS_RIGHTBUTTON)
$Checkbox[12] = GUICtrlCreateCheckbox("Dllcache文件夹", 316, 192, 100, 20, $BS_RIGHTBUTTON)
$Checkbox[13] = GUICtrlCreateCheckbox("补丁反安装文件", 24, 212, 100, 20, $BS_RIGHTBUTTON)
$Checkbox[14] = GUICtrlCreateCheckbox("回收站", 212, 212, 52, 20, $BS_RIGHTBUTTON)
$Checkbox[15] = GUICtrlCreateCheckbox("系统盘的tmp等文件", 298, 212, 118, 20, $BS_RIGHTBUTTON)
$Group4 = GUICtrlCreateGroup("清理播放器记录", 10, 252, 420, 50)
$Checkbox[16] = GUICtrlCreateCheckbox("暴风影音播放列表", 12, 272, 112, 20, $BS_RIGHTBUTTON)
$Checkbox[17] = GUICtrlCreateCheckbox("QQ影音播放列表", 165, 272, 100, 20, $BS_RIGHTBUTTON)
$Checkbox[18] = GUICtrlCreateCheckbox("迅雷播放器播放列表",292, 272, 124, 20, $BS_RIGHTBUTTON)
$Group5 = GUICtrlCreateGroup("清理迅雷下载记录", 10, 314, 420, 50)
$Checkbox[19] = GUICtrlCreateCheckbox("迅雷下载记录", 36, 334, 88, 20, $BS_RIGHTBUTTON)
$Checkbox[20] = GUICtrlCreateCheckbox("迅雷常用下载目录", 155, 334, 110, 20, $BS_RIGHTBUTTON)
$Button2 = GUICtrlCreateButton("执行(&O)", 24, 375, 60, 24)
$Button3 = GUICtrlCreateButton("取消(&E)", 130, 375, 60, 24)
GUICtrlCreateLabel("扫描进度:", 24, 420, 80, 40)
GUICtrlCreateLabel("鼎盛技术,开创未来!", 300, 385, 120, 40)
;================================================================================================================
;================================================================================================================
;对Checkbox控件进行“选择”和“反选”操作,采用UDF函数实现
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1 ;例子4,单控件切换全选/反选
_CheckboxOpt($Checkbox, $Button1, 2)
EndSwitch
WEnd
;下面这个是UDF函数,当然也可以使用别的方法来实现
;==========================================================================================UDF函数开始
; 说明: 对Checkbox复选框进行多种功能操作:
; 1,返回选中的索引;2,按关键字匹配并选中;3,全选/全不选/反选
; 4,可对单控件实现切换全选/全不选or反选(可自定义文本)|单控件单功能(如仅反选)
; 语法: _CheckboxOpt(复选框数组名[, 控件ID或'操作选项'[, 全不选或反选的标志[, '全选|全不选|反选(显示文本)']]])
; 参数: 复选框数组名 - 必须的参数(如 $Checkbox ),同时复选框变量必须为数组;
; 控件ID或'操作选项' - 这是个多选择的参数,值为'xh' (默认)将返回选中的索引,后面的参数随之无效;下同
; 值为'pp' 时将作为匹配并选中含指定文本的复选框功能,之后的 $sy 参数值则代表指定文本;
; 值为 'qx'时全选|'qbx' 时全不选|'fx' 时反选;
; 值为控件ID时,则完成单控件切换全选/全不选(反选),单控件单功能(如仅全选)的功能。
; 全不选或反选的标志 - 此参数因前一位参数的不同而具不同意义,当前个参数为'pp'时,它的值将作为指定文本;
; 而当前个参数为控件ID时,其作为切换 1 = “全不选” 或 2 = “反选” 或 0 = 不切换的开关。
; '全选|全不选|反选' - 在控件上显示的文本,可以修改,但同时界面的相关控件文本也要包含于其中。
; 作者: Afan -- http://www.autoitx.com/?fromuid=7644923
;==========================================================================================
Func _CheckboxOpt($CbName, $OptorID = 'xh', $sy = 1, $nnn = '全选|全不选|反选')
Local $gm, $Yxz = '', $nr, $n1, $n2, $n3, $nfg, $ppsl = 0, $rdtxt
If $OptorID = 'xh' Then
For $i = 0 To UBound($CbName) - 1
If GUICtrlRead($CbName[$i]) = 1 Then $Yxz &= $i & '|'
Next
Return StringTrimRight($Yxz, 1)
ElseIf $OptorID = 'pp' Then
For $i = 0 To UBound($CbName) - 1
$rdtxt = GUICtrlRead($CbName[$i], 1)
If $rdtxt <> '0' Then
If StringInStr($rdtxt, $sy) <> 0 Then
GUICtrlSetState($CbName[$i], $GUI_CHECKED)
$ppsl += 1
EndIf
EndIf
Next
If $ppsl = 0 Then MsgBox(0, '匹配结果', '没有匹配的项目')
Return $ppsl
ElseIf $OptorID = 'qx' Then
qxuanf($CbName, 'qx')
Return
ElseIf $OptorID = 'qbx' Then
qxuanf($CbName, 'qbx')
Return
ElseIf $OptorID = 'fx' Then
qxuanf($CbName, 'fx')
Return
EndIf
$nr = GUICtrlRead($OptorID)
$nfg = StringSplit($nnn, '|')
If @error = 1 And $nfg[1] = '' Then
Exit (MsgBox(0, 0, '$nnn 参数设置错误'))
Else
$n1 = $nfg[1]
$n2 = $nfg[2]
$n3 = $nfg[3]
EndIf
If $sy = 1 Then $gm = $n2
If $sy = 2 Then $gm = $n3
If $nr <> $n1 And $nr <> $n2 And $nr <> $n3 Then Exit (MsgBox(48, '问题', '此控件文本名不在函数中,请核实。'))
If $nr = $n1 Then
qxuanf($CbName, 'qx')
If $sy <> 0 Then GUICtrlSetData($OptorID, $gm)
ElseIf $nr = $n2 Then
qxuanf($CbName, 'qbx')
If $sy <> 0 Then GUICtrlSetData($OptorID, $n1)
ElseIf $nr = $n3 Then
qxuanf($CbName, 'fx')
If $sy <> 0 Then GUICtrlSetData($OptorID, $n1)
EndIf
EndFunc ;==>_CheckboxOpt
Func qxuanf($CbName, $bj)
If $bj = 'qbx' Then $xuanz = $GUI_UNCHECKED
If $bj = 'qx' Then $xuanz = $GUI_CHECKED
For $i = 0 To UBound($CbName) - 1
If $bj = 'qx' Or $bj = 'qbx' Then
GUICtrlSetState($CbName[$i], $xuanz)
ElseIf $bj = 'fx' Then
If GUICtrlRead($CbName[$i]) = 1 Then
GUICtrlSetState($CbName[$i], $GUI_UNCHECKED)
ElseIf GUICtrlRead($CbName[$i]) = 4 Then
GUICtrlSetState($CbName[$i], $GUI_CHECKED)
EndIf
EndIf
Next
EndFunc ;==>qxuanf
;================================================================================================================UDF函数结束
;================================================================================================================UDF函数结束
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
EXIT
Case $Button2
;While 1
If GUICtrlRead($Checkbox[1]) = $GUI_UNCHECKED And GUICtrlRead($Checkbox[2]) = $GUI_UNCHECKED And GUICtrlRead($Checkbox[3]) = $GUI_UNCHECKED _
And GUICtrlRead($Checkbox[4]) = $GUI_UNCHECKED And GUICtrlRead($Checkbox[5]) = $GUI_UNCHECKED And GUICtrlRead($Checkbox[6]) = $GUI_UNCHECKED _
And GUICtrlRead($Checkbox[7]) = $GUI_UNCHECKED And GUICtrlRead($Checkbox[8]) = $GUI_UNCHECKED And GUICtrlRead($Checkbox[9]) = $GUI_UNCHECKED _
And GUICtrlRead($Checkbox[10]) = $GUI_UNCHECKED And GUICtrlRead($Checkbox[11]) = $GUI_UNCHECKED And GUICtrlRead($Checkbox[12]) = $GUI_UNCHECKED _
And GUICtrlRead($Checkbox[13]) = $GUI_UNCHECKED And GUICtrlRead($Checkbox[14]) = $GUI_UNCHECKED And GUICtrlRead($Checkbox[15]) = $GUI_UNCHECKED _
And GUICtrlRead($Checkbox[16]) = $GUI_UNCHECKED And GUICtrlRead($Checkbox[17]) = $GUI_UNCHECKED And GUICtrlRead($Checkbox[18]) = $GUI_UNCHECKED _
And GUICtrlRead($Checkbox[19]) = $GUI_UNCHECKED And GUICtrlRead($Checkbox[20]) = $GUI_UNCHECKED Then
$msg = MsgBox(0 + 48, "提示", "你未选择任何项目!")
;If $msg = 1 Then ExitLoop
;EndIf
ElseIf GUICtrlRead($Button2) = $GUI_EVENT_PRIMARYDOWN Then
Runscript()
MsgBox(0,"完成","操作成功完成")
EXIT
EndIf
;WEnd
Case $Button3
EXIT
EndSwitch
WEnd
Func Runscript()
If GUICtrlRead($Checkbox[1]) = $GUI_CHECKED Then
RunWait(@ComSpec & " /C rundll32.exe " & @SystemDir & "\InetCpl.cpl,ClearMyTracksByProcess 8", "", @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[2]) = $GUI_CHECKED Then
RunWait(@ComSpec & " /C rundll32.exe " & @SystemDir & "\InetCpl.cpl,ClearMyTracksByProcess 2", "", @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[3]) = $GUI_CHECKED Then
RunWait(@ComSpec & " /C rundll32.exe " & @SystemDir & "\InetCpl.cpl,ClearMyTracksByProcess 1", "", @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[4]) = $GUI_CHECKED Then
RunWait(@ComSpec & " /C rundll32.exe " & @SystemDir & "\InetCpl.cpl,ClearMyTracksByProcess 16", "", @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[5]) = $GUI_CHECKED Then
RunWait(@ComSpec & " /C rundll32.exe " & @SystemDir & "\InetCpl.cpl,ClearMyTracksByProcess 32", "", @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[6]) = $GUI_CHECKED Then
RunWait(@ComSpec & " /C rundll32.exe " & @SystemDir & "\InetCpl.cpl,ClearMyTracksByProcess 4351", "", @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[7]) = $GUI_CHECKED Then
Run(@ComSpec & ' /c del /f /q /s /a "%Userprofile%\Recent"', '', @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[8]) = $GUI_CHECKED Then
Run(@ComSpec & ' /c rd /s /q "%Tmp%"', '', @SW_HIDE)
Run(@ComSpec & ' /c md "%Tmp%"', '', @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[9]) = $GUI_CHECKED Then
Run(@ComSpec & " /c rd /s /q %windir%\temp", '', @SW_HIDE)
Run(@ComSpec & " /c md %windir%\temp", '', @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[10]) = $GUI_CHECKED Then
Run(@ComSpec & " /c rd /s /q %windir%\SoftwareDistribution\Download", '', @SW_HIDE)
Run(@ComSpec & " /c md %%\SoftwareDistribution\Download", '', @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[11]) = $GUI_CHECKED Then
Run(@ComSpec & " /c rd /s /q %windir%\prefetch", '', @SW_HIDE)
Run(@ComSpec & " /c md %windir%\prefetch", '', @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[12]) = $GUI_CHECKED Then
Run(@ComSpec & " /c del /f /q /s /a %SystemRoot%\system32\dllcache", '', @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[13]) = $GUI_CHECKED Then
Run(@ComSpec & " /c for /f %a in ('dir /ad /windirb %windir%\$*$') do rd /s /q %windir%\%a", '', @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[14]) = $GUI_CHECKED Then
Run(@ComSpec & " /c for %a in (c d e f g h i j k) do rmdir /s /q %a:\recycler >nul 2>nul & mkdir %a:\recycler >nul 2>nul & rd /s /q %a:\recycler", '', @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[15]) = $GUI_CHECKED Then
Run(@ComSpec & " /c del /f /s /q %systemdrive%\*.tmp", '', @SW_HIDE)
Run(@ComSpec & " /c del /f /s /q %systemdrive%\*._mp", '', @SW_HIDE)
Run(@ComSpec & " /c del /f /s/ q %systemdrive%\*.log", '', @SW_HIDE)
Run(@ComSpec & " /c del /f /s /q %systemdrive%\*.gid", '', @SW_HIDE)
Run(@ComSpec & " /c del /f /s /q %systemdrive%\*.chk", '', @SW_HIDE)
Run(@ComSpec & " /c del /f /s /q %systemdrive%\*.old", '', @SW_HIDE)
Run(@ComSpec & " /c del /f /s /q %windir%\*.bak", '', @SW_HIDE)
Run(@ComSpec & " /c del /f /s /q %windir%\*.ini", '', @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[16]) = $GUI_CHECKED Then
Run(@ComSpec & " /c taskkill /f /im Storm.exe", '', @SW_HIDE)
Run(@ComSpec & " /c for %a in (c d e f g h i j k) do del /f /q /s /a %a:\playlist.smpl", '', @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[17]) = $GUI_CHECKED Then
Run(@ComSpec & " /c taskkill /f /im QQPlayer.exe", '', @SW_HIDE)
Run(@ComSpec & " /c for %a in (c) do del /s /q /f /a %a:\default.qpl", '', @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[18]) = $GUI_CHECKED Then
Run(@ComSpec & " /c taskkill /f /im Xmp.exe", '', @SW_HIDE)
Run(@ComSpec & ' /c del /f /s /q /a "%ALLUSERSPROFILE%\Application Data\Thunder Network\XMP\Playlists"', '', @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[19]) = $GUI_CHECKED Then
Run(@ComSpec & " /c taskkill /f /im Thunder.exe", '', @SW_HIDE)
Run(@ComSpec & " /c for %a in (c d e f g h i j k) do del /f /q /s /a %a:\history.dat", '', @SW_HIDE)
Run(@ComSpec & " /c for %a in (c d e f g h i j k) do del /f /q /s /a %a:\history.dat.bak", '', @SW_HIDE)
Run(@ComSpec & " /c for %a in (c d e f g h i j k) do del /f /q /s /a %a:\history6.dat", '', @SW_HIDE)
Run(@ComSpec & " /c for %a in (c d e f g h i j k) do del /f /q /s /a %a:\history6.dat.rescue", '',@SW_HIDE)
Run(@ComSpec & " /c for %a in (c d e f g h i j k) do del /f /q /s /a %a:\ThunderStorage.dat", '', @SW_HIDE)
EndIf
If GUICtrlRead($Checkbox[20]) = $GUI_CHECKED Then
Run(@ComSpec & " /c taskkill /f /im Thunder.exe", '', @SW_HIDE)
Run(@ComSpec & " /c for %a in (c d e f g h i j k) do del /f /q /s /a %a:\Category.xml", '', @SW_HIDE)
EndIf
EndFunc ;==>
Func _LoadSkin($sSkinFile, $sSkinDll, $cForm)
Local $hSkinDll = DllOpen($sSkinDll)
DllCall($hSkinDll, "int:cdecl", "InitLicenKeys", "wstr", "1", "wstr", "", "wstr", "1@1.com", "wstr", "1")
DllCall($hSkinDll, "int:cdecl", "InitDecoration", "int", 1)
DllCall($hSkinDll, "int:cdecl", "LoadSkinFromFile", "wstr", $sSkinFile)
DllCall($hSkinDll, "int:cdecl", "DecorateAs", "int", $cForm, "int", 25)
DllCall($hSkinDll, "int:cdecl", "ApplySkin")
Return $hSkinDll
EndFunc ;==>_LoadSkin
Func _UnLoadSkin($hSkinDll)
GUISetState(@SW_HIDE)
DllCall($hSkinDll, "int:cdecl", "DeInitDecoration")
DllCall($hSkinDll, "int:cdecl", "RemoveSkin")
DllClose($hSkinDll)
EndFunc ;==>_UnLoadSkin
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE