本帖最后由 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
复制代码
|