lixiaolong 发表于 2011-1-2 19:16:47

Win7专用系统清理工具

本帖最后由 lixiaolong 于 2011-1-8 18:08 编辑

大家新年快乐!

Win7专用系统清理工具图


可以删除的19个项目:
删除IE缓存 = 为快速查看而保存的网页,图像和媒体的副本
删除历史文件 = 已访问网站的列表
删除Cookies = 网站存储在计算机上的文件,以保存如登陆信息等首选项
最近输入的网址链接 = 在资源管理器和IE上输入的网址,路径记录
删除表单数据 = 保存在表单中键入的信息
删除密码 = 登陆以前访问过的网站时,自动填充保存的密码
最近使用的项目 = 开始菜单里的最近使用的项目记录
运行历史 = 在"运行"里输入的记录
临时文件 = 系统临时文件
剪贴板 = 剪贴板的内容
Windows日志文件 = Windows文件夹下的所有扩展名为"log"的文件(不包含子文件夹)
回收站 = 清空回收站
Adobe Flash Player = Adobe Flash Player的配置记录
Windows Live Messenger = Messenger自动制作的扩展名为"sqm"的文件( @UserProfileDir & '\AppData\Roaming\Microsoft\MSN Messenger' 文件夹里)
Remote Desktop = 远程桌面连接的缓存
RegEdit = 最后打开注册表项目位置的记录
删除Index.dat = 由Internet Explorer和资源管理器创建的文件,个人信息,就像网址,搜索字符串和最近打开的文件,就像数据库中的索引
Media Player Classic =Media Player Classic的播放记录
缩略图缓存 = 在资源管理器上浏览方式改为缩略图时自动生产缓存文件,为了下次再浏览时能加快速度。

现在没有放出源码,虽然可以达到目的,但效率有点问题.
如果能提高效率的话打算放出源码.

2010/01/07更新内容:
1.全面优化了代码,速度比原来的快一些.

2.Windows日志文件加了删除事件查看器中的日志功能.
Windows日志文件有400多种,所以删除文件有点慢.

下面是使用Core i3 CPU 笔记本测试的结果:
使用_RunDOS函数删除Windows日志文件需要30多秒.

这个已经优化了,优化前400多行的代码》优化后代码只有一行了.
速度也快,11秒就可以完成了.

3.显示正在删除的文件,可以看到现在删除什么.
GUICtrlCreateLabel()

4.最后显示已删除文件的大小.

2010/01/08更新内容:
1.再次优化了代码,速度比原来的快一些.

在这里感谢netegg前辈给我提供代码.
这个工具不再更新了,源码我会发在源码区.

如果使用以前的版本请删除(发现有严重问题).



源码在这里
http://www.autoitx.com/thread-21045-1-1.html

Dive 发表于 2011-1-2 21:01:17

赞个{:face (125):}

netegg 发表于 2011-1-2 22:55:08

Windows日志文件?注册表项删了没有?

lixiaolong 发表于 2011-1-2 23:12:19

回复 3# netegg

对不起,没有写说明.
Windows日志文件就是Windows文件夹下的所有扩展名为"log"的文件.

netegg 发表于 2011-1-3 04:11:55

回复 4# lixiaolong

没什么,我一直在琢磨这个问题,本来想着如果你解决了,请教一下

lhylm 发表于 2011-1-4 14:31:46

强啊!有放出源码没有!!!!

lixiaolong 发表于 2011-1-5 04:46:11

本帖最后由 lixiaolong 于 2011-1-5 04:52 编辑

回复 5# netegg

前辈说的问题是???

Windows日志文件是扩展名为".log"的文件以外还有"*.chk".
其他的日志文件建议不要删除,可能系统出问题.

Win7的 C:\Windows\System32\winevt\Logs下有扩展名为".evtx"的文件.
这是事件查看器中的日志,这个可以删除(有些无法删除).

netegg 发表于 2011-1-5 06:30:48

本帖最后由 netegg 于 2011-1-5 07:55 编辑

回复 7# lixiaolong
不是文件是记录,应该是在类似dat的文件里,具体文件夹不记得了,好象是system32底下的
日志应该是个数据库文件,.log是输出的记录,不是日志本身
还有一个地方LogFiles
你可以看看,即使你把log文件删了,打开eventviewer,日志依然存在

lixiaolong 发表于 2011-1-5 07:54:53

回复 8# netegg

以下代码可以实现.

删除XP的Windows日志文件(把VBS转AU3了)
$strComputer = "."
$objWMIService = ObjGet("winmgmts:" & "{impersonationLevel=impersonate,(Backup)}!\\" & $strComputer & "\root\cimv2")

Dim $mylogs = ["application","system","security"]

For $logs = 1 To $mylogs
        $colLogFiles = $objWMIService.ExecQuery(("Select * from Win32_NTEventLogFile where LogFileName='" & $mylogs[$logs] & "'"))
        For $objLogfile In $colLogFiles
                $objLogfile.ClearEventLog()
        Next
Next

删除Win7的Windows日志文件(把BAT转AU3了)
#include<Process.au3>
_RunDos('wevtutil.exe cl "ACEEventLog"')
_RunDos('wevtutil.exe cl "Application"')
_RunDos('wevtutil.exe cl "HardwareEvents"')
_RunDos('wevtutil.exe cl "Internet Explorer"')
_RunDos('wevtutil.exe cl "Key Management Service"')
_RunDos('wevtutil.exe cl "Media Center"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-API-Tracing/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-AppID/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Application-Experience/Problem-Steps-Recorder"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Application-Experience/Program-Compatibility-Assistant"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Application-Experience/Program-Compatibility-Troubleshooter"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Application-Experience/Program-Inventory"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Application-Experience/Program-Telemetry"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-AppLocker/EXE and DLL"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-AppLocker/MSI and Script"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Audio/CaptureMonitor"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Audio/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Authentication User Interface/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Backup"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-BitLocker-DrivePreparationTool/Admin"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-BitLocker-DrivePreparationTool/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Bits-Client/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Bluetooth-MTPEnum/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-BranchCache/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-BranchCacheSMB/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-CodeIntegrity/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-CorruptedFileRecovery-Client/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-CorruptedFileRecovery-Server/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-DateTimeControlPanel/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-DeviceSync/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Dhcp-Client/Admin"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-DhcpNap/Admin"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Dhcpv6-Client/Admin"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Diagnosis-DPS/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Diagnosis-PCW/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Diagnosis-PLA/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Diagnosis-Scheduled/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Diagnosis-Scripted/Admin"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Diagnosis-Scripted/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Diagnosis-ScriptedDiagnosticsProvider/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Diagnostics-Networking/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Diagnostics-Performance/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-DiskDiagnostic/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-DiskDiagnosticDataCollector/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-DiskDiagnosticResolver/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-DriverFrameworks-UserMode/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-EapHost/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-EventCollector/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Fault-Tolerant-Heap/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-FMS/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Folder Redirection/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Forwarding/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-GroupPolicy/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Help/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-HomeGroup Control Panel/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-HomeGroup Listener Service/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-HomeGroup Provider Service/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-IKE/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-International/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-International-RegionalOptionsControlPanel/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Iphlpsvc/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Kernel-EventTracing/Admin"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Kernel-Power/Thermal-Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Kernel-StoreMgr/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Kernel-WDI/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Kernel-WHEA/Errors"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Kernel-WHEA/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Known Folders API Service"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-LanguagePackSetup/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-MCT/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-MemoryDiagnostics-Results/Debug"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-MUI/Admin"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-MUI/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-NCSI/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-NetworkAccessProtection/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-NetworkAccessProtection/WHC"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-NetworkLocationWizard/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-NetworkProfile/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-NlaSvc/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-NTLM/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-OfflineFiles/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-ParentalControls/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-PeopleNearMe/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-PowerShell/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-PrintService/Admin"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-ReadyBoost/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-ReadyBoostDriver/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Recovery/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-ReliabilityAnalysisComponent/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-RemoteApp and Desktop Connections/Admin"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-RemoteAssistance/Admin"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-RemoteAssistance/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Resource-Exhaustion-Detector/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Resource-Exhaustion-Resolver/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Resource-Leak-Diagnostic/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-RestartManager/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Security-Audit-Configuration-Client/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-TerminalServices-LocalSessionManager/Admin"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-TerminalServices-LocalSessionManager/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-TerminalServices-PnPDevices/Admin"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-TerminalServices-PnPDevices/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-TerminalServices-RDPClient/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-TerminalServices-RemoteConnectionManager/Admin"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-TerminalServices-RemoteConnectionManager/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-TZUtil/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-UAC/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-UAC-FileVirtualization/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-User Profile Service/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-VDRVROOT/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-VHDMP/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-WER-Diag/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-WFP/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Windows Defender/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Windows Defender/WHC"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Windows Firewall With Advanced Security/ConnectionSecurity"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Windows Firewall With Advanced Security/Firewall"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-WindowsBackup/ActionCenter"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-WindowsSystemAssessmentTool/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-WindowsUpdateClient/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Winlogon/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-WinRM/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Winsock-WS2HELP/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-Wired-AutoConfig/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-WLAN-AutoConfig/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-WPD-ClassInstaller/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-WPD-CompositeClassDriver/Operational"')
_RunDos('wevtutil.exe cl "Microsoft-Windows-WPD-MTPClassDriver/Operational"')
_RunDos('wevtutil.exe cl "ODiag"')
_RunDos('wevtutil.exe cl "OSession"')
_RunDos('wevtutil.exe cl "Security"')
_RunDos('wevtutil.exe cl "Setup"')
_RunDos('wevtutil.exe cl "System"')
_RunDos('wevtutil.exe cl "Windows PowerShell"')

netegg 发表于 2011-1-5 07:58:29

本帖最后由 netegg 于 2011-1-5 08:00 编辑

外部文件的我不清楚,没想过,我一直在考虑EventLog*函数如何实现枚举
我不会wmi操作,让我看基本算是天书

kingfirekkk 发表于 2011-1-5 11:15:35

呼唤源码...

卫和谐 发表于 2011-1-5 12:37:38

楼主进入创作旺盛期了,恭喜!

lin0308 发表于 2011-1-5 16:46:10

不错还有进度条

mo_shaojie 发表于 2011-1-5 21:37:05

是不是源码?学习了

lixiaolong 发表于 2011-1-5 21:56:55

回复 14# mo_shaojie

现在没有放出源码,虽然可以达到目的,但效率有点问题.
如果能提高效率的话打算放出源码.
页: [1] 2 3
查看完整版本: Win7专用系统清理工具