Re: [請益] 大量刪除檔案(有清單)的程式
※ 引述《a880923 (a880923)》之銘言:
: 今天早上在版上搜尋到這套軟體 LS - File List Generator 1.53
: http://home.a03.itscom.net/tsuzu/programing/en/
: 將硬碟的檔案 匯出excel檔
: 將許多資料重新整理過後 列出了一堆清單(超過萬筆的檔案資料)
: 裡面的檔案都需要刪除
: 請問有沒有這種指定檔案清單 然後批次刪除的軟體? thx
將下面分隔線內的文字存成副檔名為 vbs 的檔案
將清單檔拉到此檔案上放開即可
清單檔一行為一個檔案
[清單檔範例]
C:\123.txt
D:\foxy\123.mp3
[執行結果]
清單中所有檔案刪除,找不到的檔案記錄在 404.txt 文字檔中
==================================================
Function GetAppPath
Dim sPath
sPath = WScript.ScriptFullName
GetAppPath = Left(sPath, InstrRev(sPath, "\"))
End Function
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(WScript.Arguments(0), 1)
Set objLog = objFSO.CreateTextFile(GetAppPath() & "\404.txt", true)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
If objFSO.FileExists(strLine) Then
objFSO.DeleteFile(strLine)
Else
objLog.WriteLine(strLine)
End If
Loop
objLog.Close
objFile.Close
==================================================
→
07/13 23:07, , 1F
07/13 23:07, 1F
※ 編輯: Mitnick 來自: 211.74.118.178 (07/15 16:14)
→
07/18 22:47, , 2F
07/18 22:47, 2F
→
07/27 01:16, , 3F
07/27 01:16, 3F
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):
EZsoft 近期熱門文章
PTT數位生活區 即時熱門文章