中国DOS联盟

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

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

中国DOS联盟论坛
现在时间是 2026-08-08 03:44
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » 清除系统垃圾→VBS版 查看 3,222 回复 22
楼 主 清除系统垃圾→VBS版 发表于 2007-03-18 06:02 ·  中国 河北 保定 联通
银牌会员
★★★
积分 1,513
发帖 554
注册 2005-12-30 00:50
20年会员
UID 48180
性别 男
状态 离线
只在回收站右键菜单中出现,

目前可以删除
IE→缓存文件,历史记录,地址栏下拉列表,cookies,网络播放器历史记录。

系统→当前用户和所有用户的Temp文件,“运行”过的程序列表,媒体播放器历史记录,历史记录,最近打开的文档,系统预读文件,和其它如.old、.chk、.chk、.tmp文件。

http://zhenlove.com.cn/cndos/fileup/files/DeleteTemp.rar





'*****************************************************************************
' 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 ]
2 发表于 2007-03-18 12:44 ·  中国 四川 成都 联通
铂金会员
★★★★
积分 7,493
发帖 2,672
注册 2005-09-02 00:00
20年会员
UID 42173
性别 男
状态 离线
baomaboy的vbs相当的厉害啊,呵呵,强烈建议9527也把私藏的vbs放出来让大家学习!

C:\>BLOG http://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'>"
3 发表于 2007-03-18 12:55 ·  中国 广东 广州 电信
中级用户
★★
脚本爱好者
积分 238
发帖 93
注册 2007-03-11 13:38
19年会员
UID 81417
性别 男
来自 GZ
状态 离线
请问用什么工具来加密VBS代码最好?
4 发表于 2007-03-18 12:57 ·  中国 河北 保定 联通
银牌会员
★★★
积分 1,513
发帖 554
注册 2005-12-30 00:50
20年会员
UID 48180
性别 男
状态 离线
Originally posted by axi at 2007-3-18 12:55:
请问用什么工具来加密VBS代码最好?


可以vbsToexe最好是封装为DLL
5 发表于 2007-03-18 14:46 ·  中国 四川 成都 联通
铂金会员
★★★★
积分 7,493
发帖 2,672
注册 2005-09-02 00:00
20年会员
UID 42173
性别 男
状态 离线
http://hometown.aol.de/_ht_a/memtronic/MemTronic_CruncherCompressor.html


虽然是JS,但是可以参观一下德国人可以把脚本混淆到什么地步。

C:\>BLOG http://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'>"
6 发表于 2007-03-19 11:22 ·  中国 黑龙江 牡丹江 电信
中级用户
★★
积分 216
发帖 129
注册 2007-02-14 07:26
19年会员
UID 79469
性别 男
状态 离线
实验一下不能成功哦
7 发表于 2007-03-19 11:30 ·  中国 河北 保定 联通
银牌会员
★★★
积分 1,513
发帖 554
注册 2005-12-30 00:50
20年会员
UID 48180
性别 男
状态 离线
Originally posted by xswdong at 2007-3-19 11:22:
实验一下不能成功哦

?????
8 发表于 2007-03-19 15:48 ·  中国 河北 保定 联通
银牌会员
★★★
积分 1,513
发帖 554
注册 2005-12-30 00:50
20年会员
UID 48180
性别 男
状态 离线
Originally posted by electronixtar at 2007-3-18 14:46:
http://hometown.aol.de/_ht_a/memtronic/MemTronic_CruncherCompressor.html


虽然是JS,但是可以参观一下德国人可以把脚本混淆到什么地步。


虽然解开了一步,但还是看不懂,也许还可以在进一步解码,再看看吧

http://zhenlove.com.cn/cndos/fileup/files/hometown.aol.de_Code.rar
9 发表于 2007-04-23 08:37 ·  中国 广东 广州 海珠区 电信
银牌会员
★★★
积分 1,206
发帖 517
注册 2007-03-25 01:18
19年会员
UID 82819
性别 男
状态 离线
不可以给源码么??

想知道 vbs 怎么处理windows历史记录和自动完成功能的。。
知,不觉多。不知,乃求知
10 发表于 2007-04-23 11:56 ·  中国 湖南 邵阳 电信
初级用户
积分 69
发帖 37
注册 2007-01-01 14:22
19年会员
UID 75195
性别 男
状态 离线
希望各位大侠能把原理讲解得再清楚一点。谢谢。
11 发表于 2007-08-27 01:53 ·  中国 贵州 贵阳 华为云
新手上路
积分 2
发帖 2
注册 2007-08-22 02:05
18年会员
UID 95559
性别 男
状态 离线
睇睇睇睇。。。。。。
12 发表于 2007-08-27 15:25 ·  中国 江西 南昌 电信
新手上路
积分 18
发帖 10
注册 2007-01-29 10:56
19年会员
UID 78034
性别 男
状态 离线
能否对内公布下源码,学习下经验嘛
13 发表于 2007-08-27 17:09 ·  中国 陕西 西安 电信
铂金会员
★★★★
积分 5,212
发帖 2,478
注册 2007-02-08 23:39
19年会员
UID 79003
性别 男
状态 离线
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

本帖最近评分记录 (共 1 条) 点击查看详情
评分人分数时间
plp626 +4 2008-02-28 21:34
14 发表于 2007-08-27 18:17 ·  中国 江苏 苏州 联通
新手上路
积分 13
发帖 7
注册 2007-08-27 02:15
18年会员
UID 95911
性别 男
状态 离线
顶啊。源码发出来咯。顶死你。老大。
15 发表于 2007-08-27 18:18 ·  中国 江苏 苏州 联通
新手上路
积分 13
发帖 7
注册 2007-08-27 02:15
18年会员
UID 95911
性别 男
状态 离线
老大。怎么封装这个VBS源代码呢。。
论坛跳转: