您好,登錄后才能下訂單哦!
小編給大家分享一下服務(wù)器中如何根據(jù)創(chuàng)建日期和訪問(wèn)日期清理文件,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
Function FilesTree(sPath) Set oFso = CreateObject("Scripting.FileSystemObject") Set oFolder = oFso.getfolder(sPath) Set oSubFolders = oFolder.SubFolders Set oFiles = oFolder.Files For Each oFile In oFiles 'WScript.Echo oFile.Path 'oFile.Delete fcdate = oFile.DateCreated fadata = oFile.DateLastAccessed If DateDiff("d", fcdate, fadata) > 0 Then 'after created, having accessed. If DateDiff("d", fadata, Now) > 90 Then oFile.Delete End If Else If DateDiff("d", fcdate, Now) > 90 Then oFile.Delete End If End If Next For Each oSubFolder In oSubFolders 'WScript.Echo oSubFolder.Path 'oSubFolder.Delete FilesTree (oSubFolder.Path) ' Next Set oFolder = Nothing Set oSubFolders = Nothing Set oFso = Nothing End Function FilesTree ("D:\Share")
看完了這篇文章,相信你對(duì)“服務(wù)器中如何根據(jù)創(chuàng)建日期和訪問(wèn)日期清理文件”有了一定的了解,如果想了解更多相關(guān)知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。