|
baomaboy
银牌会员
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
『楼 主』:
清除系统垃圾→VBS版
只在回收站右键菜单中出现,
目前可以删除
IE→缓存文件,历史记录,地址栏下拉列表,cookies,网络播放器历史记录。
系统→当前用户和所有用户的Temp文件,“运行”过的程序列表,媒体播放器历史记录,历史记录,最近打开的文档,系统预读文件,和其它如.old、.chk、.chk、.tmp文件。
http://zhenlove.com.cn/cndos/fileup/files/DeleteTemp.rar
Quote: | '*****************************************************************************
' 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 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'>" |
|
2007-3-18 12:44 |
|
|
axi
中级用户
脚本爱好者
积分 238
发帖 93
注册 2007-3-11 来自 GZ
状态 离线
|
『第
3 楼』:
请问用什么工具来加密VBS代码最好?
|
|
2007-3-18 12:55 |
|
|
baomaboy
银牌会员
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
『第
4 楼』:
Quote: | Originally posted by axi at 2007-3-18 12:55:
请问用什么工具来加密VBS代码最好? |
|
可以vbsToexe最好是封装为DLL
|
|
2007-3-18 12:57 |
|
|
electronixtar
铂金会员
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
|
2007-3-18 14:46 |
|
|
xswdong
中级用户
积分 216
发帖 129
注册 2007-2-14
状态 离线
|
|
2007-3-19 11:22 |
|
|
baomaboy
银牌会员
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
『第
7 楼』:
Quote: | Originally posted by xswdong at 2007-3-19 11:22:
实验一下不能成功哦 |
|
?????
|
|
2007-3-19 11:30 |
|
|
baomaboy
银牌会员
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
|
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
状态 离线
|
|
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:
Quote: | 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 |
|
|
|
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 |
|