返回列表 上一主題 發帖

[發問] 指定資料夾指定條件刪除檔案問題請教

Dim myFiles As Object, xFile As Object
xPath = "\\pcbfs02\C701\"
Set myFiles = CreateObject("Scripting.FileSystemObject").GetFolder(xPath).Files
For Each xFile In myFiles
   If xFile.DateLastModified < CDate("2010/1/1") Then xFile.Delete
Next

TOP

        靜思自在 : 知識要用心體會,才能變成自己的智慧。
返回列表 上一主題