高手帮忙改一下这清理代码
@echo off
echo 正在清除系统垃圾文件,请稍等......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo 清除系统LJ完成!
echo. & pause
上面这个是用.bat格式来运行清理的。 我想做到VB中,应该怎么改呢。做到VB后点一下清理按钮就可以的这种。谢谢了。
@echo off
echo 正在清除系统垃圾文件,请稍等......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo 清除系统LJ完成!
echo. & pause
上面这个是用.bat格式来运行清理的。 我想做到VB中,应该怎么改呢。做到VB后点一下清理按钮就可以的这种。谢谢了。
解决方案 »
- 我是新手 对论坛有些东西不懂..
- 调用CoFreeUnusedLibraries提示Sub or Function not defined
- 求个SQL语句
- save问题。
- 求教高"如何取得模块里的值,谢谢!!!
- 如何调用文本内容?
- 怎样控制MDI主窗体的ScrollBar
- 100 求购 Wise Installation System 9.01 - Professional Edition 的汉化包或者下载链接。
- 有没有愿意看一下的,我的小问题,雪地跪等!!!
- 请问winsock能不能传送文件,如txt文件,如能,举个例子吧。
- 如何才能设置WebBrower控件中页面的颜色和控制滚动条
- VB 单单运行一个空的窗口,需要VB运行库的支持吗??
或者直接用: SHELL CMD DEL...
On Error Resume Next
sDir = Left$(Environ("windir"), 3)
Kill sDir & "*.tmp"
Kill sDir & "*._mp"
Kill sDir & "*.log"
Kill sDir & "*.gid"
Kill sDir & "*.chk"
Kill sDir & "*.old"
Kill sDir & "recycled\*.*"
sDir = Environ("windir")
If (Right(sDir, 1) <> "\") Then sDir = sDir & "\"
Kill sDir & "*.bak"
Kill sDir & "prefetch\*.*"
Kill sDir & "temp\*.*"
sDir = Environ("userprofile")
If (sDir <> "") Then sDir = sDir & "\"
Kill sDir & "cookies\*.*"
Kill sDir & "recent\*.*"
Kill sDir & "Local Settings\Temporary Internet Files\*.*"
Kill sDir & "Local Settings\Temp\*.*"
MsgBox "清除系统LJ完成!", 64, "信息"End Sub
On Error Resume Next
sDir = Left$(Environ("windir"), 3)
Kill sDir & "*.tmp"
Kill sDir & "*._mp"
Kill sDir & "*.log"
Kill sDir & "*.gid"
Kill sDir & "*.chk"
Kill sDir & "*.old"
Kill sDir & "recycled\*.*"
sDir = Environ("windir")
If (Right(sDir, 1) <> "\") Then sDir = sDir & "\"
Kill sDir & "*.bak"
Kill sDir & "prefetch\*.*"
Kill sDir & "temp\*.*"
sDir = Environ("userprofile")
If (sDir <> "") Then
sDir = sDir & "\"
Kill sDir & "cookies\*.*"
Kill sDir & "recent\*.*"
Kill sDir & "Local Settings\Temporary Internet Files\*.*"
Kill sDir & "Local Settings\Temp\*.*"
End If
MsgBox "清除系统LJ完成!", 64, "信息"End Sub