【文件属性】:
文件名称:VBS定时删除文件脚本
文件大小:645B
文件格式:TXT
更新时间:2016-03-20 06:16:09
定时
VBS定时删除文件脚本
Function DeleteLog( )
Dim objFSO, objFolder, strPath, targetFSO, subFSO, DirPath
DirPath = createobject("Scripting.FileSystemObject").GetFile(Wscript.ScriptFullName).ParentFolder.Path&"\Log\"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set targetFSO = objFSO.GetFolder(DirPath)
Set subFSO = targetFSO.SubFolders
For Each subFolder in SubFSO
If DateDiff("d", subFolder.name, date)>3 Then
strPath = DirPath&subFolder;.name
objFSO.DeleteFolder(strPath)
End If
Next
End Function
网友评论
- 完全不知道写的什么
- 这个真不错,用来直接删除系统垃圾