中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 搜索 | 上传 | 帮助 »
作者:
标题: 清除系统垃圾→VBS版 上一主题 | 下一主题
baomaboy
银牌会员





积分 1513
发帖 554
注册 2005-12-30
状态 离线
『楼 主』:  清除系统垃圾→VBS版

只在回收站右键菜单中出现, 目前可以删除 IE→缓存文件,历史记录,地址栏下拉列表,cookies,网络播放器历史记录。 系统→当前用户和所有用户的Temp文件,“运行”过的程序列表,媒体播放器历史记录,历史记录,最近打开的文档,系统预读文件,和其它如.old、.chk、.chk、.tmp文件。 zhenlove.com.cn/cndos/fileup/f ...
'***************************************************************************** ' FileName: DeleteTemp.VBS ' Author: baomaboy ' Abstract: 删除清理系统临时文件及垃圾信息 '***************************************************************************** Dim WshSHell,FSO On Error Resume Next Set WshSHell = WScript.CreateObject("WScript.Shell") Set FSO = CreateObject("Scripting.FileSystemObject") Set WinVer = WshSHell.Environment("Process") Set Args = WScript.Arguments CloseTime = 5 FileName = WScript.ScriptName FileFullName = WScript.ScriptFullName FilePath = FSO.GetParentFolderName(FileFullName) InsPath = FSO.GetSpecialFolder(1)'''0=windows,1=system32,2=user-Temp, InsFullName = FSO.BuildPath(InsPath ,FileName) OtherFileName="clearIEcache.exe" OtherFilePath=FSO.BuildPath(InsPath ,OtherFileName) TemFileName="DeleteTemp.Bat" TemFilePath=FSO.BuildPath(InsPath ,TemFileName) Copyright="玲珑科技" QQ="QQ:25926183" Email="Email:25926183@qq.com" InsTitle="清除系统垃圾文件" InsAnswer="清除系统垃圾文件" RegPath1="HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\Shell\DeleteTemp\" RegValue1="删垃圾信息(&D)" RegForm1="REG_SZ" RegPath2="HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\Shell\DeleteTemp\command\" RegValue2="wscript.exe "&InsFullName RegForm2="REG_SZ" IF FileFullName <> InsFullName then intAnswer = MsgBox("【是】将“"+ InsAnswer +"”加入到回收站右键菜单,"&Chr(10)&Chr(10)&"【否】将“"+ InsAnswer +"”从回收站右键菜单删除。 ", vbQuestion + vbYesNoCancel, "安装 - "+ InsTitle +" - by baomaboy") If intAnswer = vbYes Then WshSHell.RegWrite RegPath1,RegValue1,RegForm1 WshSHell.RegWrite RegPath2,RegValue2,RegForm2 FSO.GetFile(FileFullName).Copy(InsFullName) If (FSO.FileExists(FSO.BuildPath(FilePath,"clearIEcache.llkj"))) Then FSO.GetFile(FSO.BuildPath(FilePath,"clearIEcache.llkj")).Copy(OtherFilePath) else Call alltovbs end if WshSHell.popup _ "添加脚本文件:"+chr(10)+InsFullName+chr(10)+chr(10)+ _ "添加注册表项:"+chr(10)+chr(34)+ RegPath1 +chr(34)+chr(10)+ _ chr(10) & CloseTime & " 秒钟后本窗口将自动关闭!" +chr(10)+chr(10)+ _ chr(10) & "Copyright(C) " + Copyright +" " & QQ &" " + Email _ , CloseTime, "安装成功 - "+ InsTitle +" - by baomaboy", 0 + 64 end if If intAnswer = vbNo Then WshSHell.RegDelete RegPath2 WshSHell.RegDelete RegPath1 FSO.DeleteFile InsFullName FSO.DeleteFile OtherFilePath WshSHell.popup _ "删除脚本文件:"+chr(10)+InsFullName+chr(10)+chr(10)+ _ "删除注册表项:"+chr(10)+chr(34)+ RegPath1 +chr(34)+chr(10)+ _ chr(10) & CloseTime & " 秒钟后本窗口将自动关闭!" +chr(10)+chr(10)+ _ chr(10) & "Copyright(C) " + Copyright +" " & QQ &" " + Email _ , CloseTime, "卸载成功 - "+ InsTitle +" - by baomaboy", 0 + 64 end if If intAnswer = vbCancel Then end if Else WshSHell.Run (OtherFilePath),vbHide Call Install WSHShell.RegWrite"HKCU\Software\Microsoft\Internet Explorer\TypedURLs\",""'''清除IE地址栏下拉列表 WSHShell.RegDelete"HKCU\Software\Microsoft\Internet Explorer\TypedURLs\" WSHShell.RegWrite"HKCU\Software\Microsoft\Internet Explorer\TypedURLs\url1","" WSHShell.RegWrite"HKCU\Software\Microsoft\Internet Explorer\Media\Internet\",""'''清除IE媒体播放器历史记录 WSHShell.RegDelete"HKCU\Software\Microsoft\Internet Explorer\Media\Internet\" WSHShell.RegWrite"HKEY_USERS\.DEFAULT\Software\Microsoft\Internet Explorer\Media\Internet\","" WSHShell.RegDelete"HKEY_USERS\.DEFAULT\Software\Microsoft\Internet Explorer\Media\Internet\" WSHShell.RegWrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMru\",""'''清除开始→运行的历史记录 WSHShell.RegDelete"HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMru\" WSHShell.RegWrite"HKCU\Software\Microsoft\MediaPlayer\Player\RecentFileList\",""'''媒体播放器文件列表 WSHShell.RegDelete"HKCU\Software\Microsoft\MediaPlayer\Player\RecentFileList\" WSHShell.RegWrite"HKCU\Software\Microsoft\MediaPlayer\Player\RecentURLList\",""'''媒体播放器网络列表 WSHShell.RegDelete"HKCU\Software\Microsoft\MediaPlayer\Player\RecentURLList\" WshSHell.Run ("%COMSPEC% /C "&TemFilePath),vbHide End if Set WshSHell = Nothing Set FSO = Nothing Set Args = Nothing WScript.Quit(0) Sub Install() Set NewFile = FSO.CreateTextFile(TemFilePath, True) NewFile.WriteLine("@echo off") NewFile.WriteLine("echo 正在清理系统垃圾文件,请稍等......") NewFile.WriteLine("del /f /s /q %systemdrive%\*.tmp") NewFile.WriteLine("del /f /s /q %systemdrive%\*._mp") NewFile.WriteLine("del /f /s /q %systemdrive%\*.log") NewFile.WriteLine("del /f /s /q %systemdrive%\*.gid") NewFile.WriteLine("del /f /s /q %systemdrive%\*.chk") NewFile.WriteLine("del /f /s /q %systemdrive%\*.old") NewFile.WriteLine("del /f /s /q %systemdrive%\recycled\*.*") NewFile.WriteLine("del /f /s /q %windir%\*.bak") NewFile.WriteLine("del /f /s /q %windir%\prefetch\*.*") NewFile.WriteLine("del /f /s /q %windir%\temp\*.*") NewFile.WriteLine("del /f /q %userprofile%\cookies\*.*") NewFile.WriteLine("del /f /q %userprofile%\recent\*.*") NewFile.WriteLine("del /f /s /q "&chr(34)&"%userprofile%\Local Settings\Temporary Internet Files\*.*"&chr(34)) NewFile.WriteLine("del /f /s /q "&chr(34)&"%userprofile%\Local Settings\Temp\*.*"&chr(34)) NewFile.WriteLine("del /f /s /q "&chr(34)&"%userprofile%\recent\*.*"&chr(34)) NewFile.WriteLine("echo 清理系统垃圾完成!") NewFile.WriteLine("rem echo. & pause ") NewFile.WriteLine("del /f /s /q %0")'''删除自己 NewFile.WriteLine("Exit") NewFile.Close End Sub sub alltovbs() '''********************** end function
[ Last edited by baomaboy on 2008-3-24 at 09:55 PM ]


2007-3-18 06:02
查看资料  发送邮件  发短消息  网志   编辑帖子  回复  引用回复
electronixtar
铂金会员





积分 7493
发帖 2672
注册 2005-9-2
状态 离线
『第 2 楼』:  

baomaboy的vbs相当的厉害啊,呵呵,强烈建议9527也把私藏的vbs放出来让大家学习!




C:\>BLOG initiative.yo2.cn/ C:\>hh.exe ntcmds.chm::/ntcmds.htm C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
2007-3-18 12:44
查看资料  发送邮件  发短消息  网志   编辑帖子  回复  引用回复
axi
中级用户

脚本爱好者


积分 238
发帖 93
注册 2007-3-11
来自 GZ
状态 离线
『第 3 楼』:  

请问用什么工具来加密VBS代码最好?


2007-3-18 12:55
查看资料  发短消息  网志  OICQ (453623262)  编辑帖子  回复  引用回复
baomaboy
银牌会员





积分 1513
发帖 554
注册 2005-12-30
状态 离线
『第 4 楼』:  

Originally posted by axi at 2007-3-18 12:55: 请问用什么工具来加密VBS代码最好?
可以vbsToexe最好是封装为DLL


2007-3-18 12:57
查看资料  发送邮件  发短消息  网志   编辑帖子  回复  引用回复
electronixtar
铂金会员





积分 7493
发帖 2672
注册 2005-9-2
状态 离线
『第 5 楼』:  

hometown.aol.de/_ht_a/memtroni ... 虽然是JS,但是可以参观一下德国人可以把脚本混淆到什么地步。




C:\>BLOG initiative.yo2.cn/ C:\>hh.exe ntcmds.chm::/ntcmds.htm C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
2007-3-18 14:46
查看资料  发送邮件  发短消息  网志   编辑帖子  回复  引用回复
xswdong
中级用户





积分 216
发帖 129
注册 2007-2-14
状态 离线
『第 6 楼』:  

实验一下不能成功哦


2007-3-19 11:22
查看资料  发送邮件  发短消息  网志   编辑帖子  回复  引用回复
baomaboy
银牌会员





积分 1513
发帖 554
注册 2005-12-30
状态 离线
『第 7 楼』:  

Originally posted by xswdong at 2007-3-19 11:22: 实验一下不能成功哦
?????


2007-3-19 11:30
查看资料  发送邮件  发短消息  网志   编辑帖子  回复  引用回复
baomaboy
银牌会员





积分 1513
发帖 554
注册 2005-12-30
状态 离线
『第 8 楼』:  

Originally posted by electronixtar at 2007-3-18 14:46: hometown.aol.de/_ht_a/memtroni ... 虽然是JS,但是可以参观一下德国人可以把脚本混淆到什么地步。
虽然解开了一步,但还是看不懂,也许还可以在进一步解码,再看看吧 zhenlove.com.cn/cndos/fileup/f ...


2007-3-19 15:48
查看资料  发送邮件  发短消息  网志   编辑帖子  回复  引用回复
flyinspace
银牌会员





积分 1206
发帖 517
注册 2007-3-25
状态 离线
『第 9 楼』:  

不可以给源码么?? 想知道 vbs 怎么处理windows历史记录和自动完成功能的。。




知,不觉多。不知,乃求知
2007-4-23 08:37
查看资料  发短消息  网志   编辑帖子  回复  引用回复
fengjing001
初级用户





积分 69
发帖 37
注册 2007-1-1
状态 离线
『第 10 楼』:  

希望各位大侠能把原理讲解得再清楚一点。谢谢。


2007-4-23 11:56
查看资料  发短消息  网志   编辑帖子  回复  引用回复
pandazzz
新手上路





积分 2
发帖 2
注册 2007-8-22
状态 离线
『第 11 楼』:  

睇睇睇睇。。。。。。


2007-8-27 01:53
查看资料  发送邮件  发短消息  网志   编辑帖子  回复  引用回复
langhuan1
新手上路





积分 18
发帖 10
注册 2007-1-29
状态 离线
『第 12 楼』:  

能否对内公布下源码,学习下经验嘛


2007-8-27 15:25
查看资料  发送邮件  发短消息  网志   编辑帖子  回复  引用回复
slore
铂金会员





积分 5212
发帖 2478
注册 2007-2-8
状态 离线
『第 13 楼』:  

DeCode:
Dim WshSHell,FSO on Error Resume Next Set WshSHell = WScript.CreateObject("WScript.Shell") Set FSO = CreateObject("Scripting.FileSystemObject") Set WinVer = WshSHell.Environment("Process") Set Args = WScript.Arguments CloseTime = 5 FileName = WScript.ScriptName FileFullName = WScript.ScriptFullName FilePath = FSO.GetParentFolderName(FileFullName) InsPath = FSO.GetSpecialFolder(1) InsFullName = FSO.BuildPath(InsPath ,FileName) LnkPathNT = WshSHell.SpecialFolders(2) LnkPath9X = WshSHell.SpecialFolders(14) LnkPathAll = WshSHell.SpecialFolders("MyDocuments") OtherFileName = "clearIEcache.exe" OtherFilePath = FSO.BuildPath(InsPath ,OtherFileName) TemFileName = "DeleteTemp.Bat" TemFilePath = FSO.BuildPath(InsPath ,TemFileName) Copyright = "玲珑科技" QQ = "QQ:25926183" Email = "Email:fty1995@163.com" InsTitle = "清除系统垃圾文件" InsAnswer = "清除系统垃圾文件" RegPath1 = "HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\Shell\DeleteTemp\" RegValue1 = "清除系统垃圾(&D)" RegForm1 = "REG_SZ" RegPath2 = "HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\Shell\DeleteTemp\command\" RegValue2 = "wscript.exe " & InsFullName RegForm2 = "REG_SZ" If FileFullName <> InsFullName Then intAnswer = MsgBox("【是】将“" + InsAnswer + "”加入到回收站右键菜单," & Chr(10) & Chr(10) & "【否】将“" + InsAnswer + "”从回收站右键菜单删除。 ", vbQuestion + vbYesNoCancel, "安装 - " + InsTitle + " - " + Copyright) If intAnswer = vbYes Then WshSHell.RegWrite RegPath1,RegValue1,RegForm1 WshSHell.RegWrite RegPath2,RegValue2,RegForm2 FSO.GetFile(FileFullName).Copy(InsFullName) If (FSO.FileExists(FSO.BuildPath(FilePath,"clearIEcache.llkj"))) Then FSO.GetFile(FSO.BuildPath(FilePath,"clearIEcache.llkj")).Copy(OtherFilePath) Else Call alltovbs End If WshSHell.popup _ "添加脚本文件:" + Chr(10) + InsFullName + Chr(10) + Chr(10) + _ "添加注册表项:" + Chr(10) + Chr(34) + RegPath1 + Chr(34) + Chr(10) + _ Chr(10) & CloseTime & " 秒钟后本窗口将自动关闭!" + Chr(10) + Chr(10) + _ Chr(10) & "Copyright(C) " + Copyright + " " & QQ & " " + Email _ , CloseTime, "安装成功 - " + InsTitle + " - " + Copyright, 0 + 64 End If If intAnswer = vbNo Then WshSHell.RegDelete RegPath2 WshSHell.RegDelete RegPath1 FSO.DeleteFile InsFullName FSO.DeleteFile OtherFilePath WshSHell.popup _ "删除脚本文件:" + Chr(10) + InsFullName + Chr(10) + Chr(10) + _ "删除注册表项:" + Chr(10) + Chr(34) + RegPath1 + Chr(34) + Chr(10) + _ Chr(10) & CloseTime & " 秒钟后本窗口将自动关闭!" + Chr(10) + Chr(10) + _ Chr(10) & "Copyright(C) " + Copyright + " " & QQ & " " + Email _ , CloseTime, "卸载成功 - " + InsTitle + " - " + Copyright, 0 + 64 End If If intAnswer = vbCancel Then End If Else WshSHell.Run (OtherFilePath),vbHide Call Install If WinVer("OS") <> "Windows_NT" Then CMD = "Command.com /C " Else CMD = "CMD.exe /C " End If WSHShell.RegWrite"HKCU\Software\Microsoft\Internet Explorer\TypedURLs\0","" WSHShell.RegDelete"HKCU\Software\Microsoft\Internet Explorer\TypedURLs\" WSHShell.RegWrite"HKCU\Software\Microsoft\Internet Explorer\TypedURLs\url1","" WSHShell.RegWrite"HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Media\Internet\0","" WSHShell.RegDelete"HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Media\Internet\" WSHShell.RegWrite"HKEY_USERS\.DEFAULT\Software\Microsoft\Internet Explorer\Media\Internet\0","" WSHShell.RegDelete"HKEY_USERS\.DEFAULT\Software\Microsoft\Internet Explorer\Media\Internet\" WSHShell.RegWrite"HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMru\","" WSHShell.RegDelete"HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMru\" WSHShell.RegWrite"HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Player\RecentFileList\","" WSHShell.RegDelete"HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Player\RecentFileList\" WSHShell.RegWrite"HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Player\RecentURLList\","" WSHShell.RegDelete"HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Player\RecentURLList\" WshSHell.Run (Cmd & TemFilePath),vbHide End If Set WshSHell = Nothing Set FSO = Nothing Set Args = Nothing WScript.Quit(0) Sub Install() Set NewFile = FSO.CreateTextFile(TemFilePath, True) NewFile.WriteLine("@echo off") NewFile.WriteLine("echo 正在清理系统垃圾文件,请稍等......") NewFile.WriteLine("del /f /s /q %systemdrive%\*.tmp") NewFile.WriteLine("del /f /s /q %systemdrive%\*._mp") NewFile.WriteLine("del /f /s /q %systemdrive%\*.log") NewFile.WriteLine("del /f /s /q %systemdrive%\*.gid") NewFile.WriteLine("del /f /s /q %systemdrive%\*.chk") NewFile.WriteLine("del /f /s /q %systemdrive%\*.old") NewFile.WriteLine("del /f /s /q %systemdrive%\recycled\*.*") NewFile.WriteLine("del /f /s /q %windir%\*.bak") NewFile.WriteLine("del /f /s /q %windir%\prefetch\*.*") NewFile.WriteLine("rd /s /q %windir%\temp & md %windir%\temp") NewFile.WriteLine("del /f /q %userprofile%\cookies\*.*") NewFile.WriteLine("del /f /q %userprofile%\recent\*.*") NewFile.WriteLine("del /f /s /q " & Chr(34) & "%userprofile%\Local Settings\Temporary Internet Files\*.*" & Chr(34)) NewFile.WriteLine("del /f /s /q " & Chr(34) & "%userprofile%\Local Settings\Temp\*.*" & Chr(34)) NewFile.WriteLine("del /f /s /q " & Chr(34) & "%userprofile%\recent\*.*" & Chr(34)) NewFile.WriteLine("echo 清理系统垃圾完成!") NewFile.WriteLine("rem echo. & pause ") NewFile.WriteLine("del /f /s /q %0") NewFile.WriteLine("Exit") NewFile.Close End Sub


   此帖被 +4 点积分        点击查看详情   
评分人:【 plp626 分数: +4  时间:2008-2-28 21:34


2007-8-27 17:09
查看资料  发短消息  网志   编辑帖子  回复  引用回复
adminsystem
新手上路




积分 13
发帖 7
注册 2007-8-27
状态 离线
『第 14 楼』:  

顶啊。源码发出来咯。顶死你。老大。


2007-8-27 18:17
查看资料  发送邮件  发短消息  网志   编辑帖子  回复  引用回复
adminsystem
新手上路




积分 13
发帖 7
注册 2007-8-27
状态 离线
『第 15 楼』:  

老大。怎么封装这个VBS源代码呢。。


2007-8-27 18:18
查看资料  发送邮件  发短消息  网志   编辑帖子  回复  引用回复

请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: