''filna="F:\Songs"
filna=InputBox("Enter required folder path." & vbNewLine & "* Folder path to delete dulicate files from desired folder path."& vbNewLine & "ex: C:\songsFolder")
Call DeleteDupFiles(filna)
Function DeleteDupFiles(strFilePath)
Set objfs=CreateObject("Scripting.FileSystemObject")
set sfol= objfs.GetFolder(strFilePath)
Set sfil=sfol.Files
i=0
For each el in sfil
If instr (1, el.Name, "copy", 1)>0 Then
i=i+1
el.Delete
End If
Next
msgbox "Total Duplicate Copies deleted: "& i
End Function
filna=InputBox("Enter required folder path." & vbNewLine & "* Folder path to delete dulicate files from desired folder path."& vbNewLine & "ex: C:\songsFolder")
Call DeleteDupFiles(filna)
Function DeleteDupFiles(strFilePath)
Set objfs=CreateObject("Scripting.FileSystemObject")
set sfol= objfs.GetFolder(strFilePath)
Set sfil=sfol.Files
i=0
For each el in sfil
If instr (1, el.Name, "copy", 1)>0 Then
i=i+1
el.Delete
End If
Next
msgbox "Total Duplicate Copies deleted: "& i
End Function
No comments:
Post a Comment