Dim $lajibox[10]
Dim $del = " /C del /f /s /q /a ", $del2 = " /C del /f /q /a ", $rd = " /C rd /s /q "
Dim $CLA = 0,$tishi



Func qinglilaji()
	A()
	B()
	C()
	D()
	E()
	F()
	G()
	H()
	OK()
EndFunc

Func A()
	GUICtrlSetData($tishi,"正在清理临时文件夹")
	RunWait(@ComSpec & $del & '"%temp%\*.*"', "", @SW_HIDE)
	RunWait(@ComSpec & $del & '"%tmp%\*.*"', "", @SW_HIDE)
		
	RunWait(@ComSpec & $del & '"%systemroot%\minidump\*.*"', "", @SW_HIDE)
	RunWait(@ComSpec & $del & '"%systemroot%\Prefetch\*.*"', "", @SW_HIDE)
EndFunc

Func B()
	GUICtrlSetData($tishi,"正在清理系统目录垃圾")
	RunWait(@ComSpec & $del2 & '"%systemdrive%\*.tmp"', "", @SW_HIDE)
	RunWait(@ComSpec & $del2 & '"%systemdrive%\*._mp"', "", @SW_HIDE)
	RunWait(@ComSpec & $del2 & '"%systemdrive%\*.log"', "", @SW_HIDE)
	RunWait(@ComSpec & $del2 & '"%systemdrive%\*.gid"', "", @SW_HIDE)
	RunWait(@ComSpec & $del2 & '"%systemdrive%\*.chk"', "", @SW_HIDE)
	RunWait(@ComSpec & $del2 & '"%systemdrive%\*.old"', "", @SW_HIDE)
		
	RunWait(@ComSpec & $del2 & '"%systemroot%\*.tmp"', "", @SW_HIDE)
	RunWait(@ComSpec & $del2 & '"%systemroot%\*._mp"', "", @SW_HIDE)
	RunWait(@ComSpec & $del2 & '"%systemroot%\*.dmp"', "", @SW_HIDE)
	RunWait(@ComSpec & $del2 & '"%systemroot%\*.gid"', "", @SW_HIDE)
	RunWait(@ComSpec & $del2 & '"%systemroot%\*.chk"', "", @SW_HIDE)
	RunWait(@ComSpec & $del2 & '"%systemroot%\*.old"', "", @SW_HIDE)
	RunWait(@ComSpec & $del2 & '"%systemroot%\*.bak"', "", @SW_HIDE)
	RunWait(@ComSpec & $del2 & '"%systemroot%\*.query"', "", @SW_HIDE)
		
	RunWait(@ComSpec & $del & '"%ALLUSERSPROFILE%\Documents\DrWatson\*.*"', "", @SW_HIDE)
EndFunc

Func C()
	GUICtrlSetData($tishi,"正在清理升级补丁目录")
	RunWait(@ComSpec & $del2 & '"%systemroot%\$*$"', "", @SW_HIDE)
EndFunc

Func D()
	GUICtrlSetData($tishi,"正在清理文档打开记录")
	If RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "Recent") <> "" Then
		RunWait(@ComSpec & $del & '"' & RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "Recent") & '\*.*"', "", @SW_HIDE)
	EndIf
	RunWait(@ComSpec & $del & '"%USERPROFILE%\Application Data\Microsoft\Office\Recent\*.lnk', "", @SW_HIDE)
EndFunc

Func E()
	GUICtrlSetData($tishi,"正在清理搜索运行记录")
	RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU")
	RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU")
	RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\DocFindSpecMRU")
	RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\DocFindSpecMRU")
EndFunc

Func F()
	GUICtrlSetData($tishi,"正在清理IE 缓存记录")
	$IE_Cache = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "Cache")
	If $IE_Cache <> "" Then
		FileSetAttrib($IE_Cache, "-rashnot", 1)
		RunWait(@ComSpec & $del & '"' & $IE_Cache & '\*.*"', "", @SW_HIDE)
	EndIf
EndFunc

Func G()
	GUICtrlSetData($tishi,"正在清理IE 历史记录")
	If RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "History") <> "" Then
		RunWait(@ComSpec & $del & '"' & RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "History") & '\*.*"', "", @SW_HIDE)
	ElseIf RegRead("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "History") <> "" Then
		RunWait(@ComSpec & $del & '"' & RegRead("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "History") & '\*.*"', "", @SW_HIDE)
	EndIf
EndFunc

Func H()
	GUICtrlSetData($tishi,"正在清理IE Cookies")
	If RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "cookies") <> "" Then
		RunWait(@ComSpec & $del & '"' & RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "cookies") & '\*.*"', "", @SW_HIDE)
	ElseIf RegRead("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "cookies") <> "" Then
		RunWait(@ComSpec & $del & '"' & RegRead("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "cookies") & '\*.*"', "", @SW_HIDE)
	EndIf
EndFunc

Func ok()
	GUICtrlSetData($tishi,"所有系统垃圾都已清理完毕")
	Sleep(500)
	GUICtrlSetData($tishi,"")
EndFunc