标题: [问题求助] VBS能否删除开始----文档里抽历史记录? [打印本页]
作者: ww0000 时间: 2013-9-5 11:36 标题: VBS能否删除开始----文档里抽历史记录?
VBS能否删除开始----文档里抽历史记录?
C:\Documents and Settings\Administrator\Recent
Recent文件夹是隐藏的!
作者: batman 时间: 2013-9-5 15:53
- Dim objFSO, Path
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- Path = "C:\Documents and Settings\Administrator\Recent"
- For Each File In objFSO.GetFolder(Path).Files
- objFSO.DeleteFile File
- Next
- Set objFSO = Nothing
- WScript.Echo "OK"
复制代码
作者: ww0000 时间: 2013-9-5 16:55
回复 2# batman
谢谢,能删除!
但我将
C:\Documents and Settings\Administrator\Recent
换成
C:\Documents and Settings\Administrator\Local Settings\Temporary Internet Files
为什么不能删除上网历史记录呢?
作者: ww0000 时间: 2013-9-5 17:31
本帖最后由 ww0000 于 2013-9-6 08:14 编辑
这个网上找的,也不行- On error resume Next
- Set WshShell = WScript.CreateObject("WScript.Shell")
- Set WshSysEnv = WshShell.Environment("Process")
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- Const DeleteReadOnly = TRUE
- objFSO.DeleteFile(WshSysEnv("userprofile") & "\Local Settings\Temporary Internet Files\*.*"), DeleteReadOnly
- objFSO.DeleteFile(WshSysEnv("userprofile") & "\Local Settings\Temp\*.*"),DeleteReadOnly
- ShowSubFolders objFSO.GetFolder(WshSysEnv("userprofile") & "\Local Settings\Temporary Internet Files\")
- ShowSubFolders objFSO.GetFolder(WshSysEnv("userprofile") & "\Local Settings\Temp\")
- Sub ShowSubFolders(Folder)
- For Each Subfolder in Folder.SubFolders
- objFSO.DeleteFile(Subfolder.Path & "\*.*"), DeleteReadOnly
- ShowSubFolders Subfolder
- Next
- End Sub
复制代码
欢迎光临 批处理之家 (http://bathome.net./) |
Powered by Discuz! 7.2 |