VBS Script to Scan for Duplicate Files Using UNC Path
Source Coude VBS Script untuk duplicate file menggunakan Directory UNC
Set objDictionary = CreateObject("Scripting.Dictionary") Set objFSO = CreateObject("Scripting.FileSystemObject") strStartFolder = "C:\Scripts" Set objFolder = objFSO.GetFolder(strStartFolder) Set colFiles = objFolder.Files For Each objFile in colFiles strName = objFile.Name strPath = objFile.Path If Not objDictionary.Exists(strName) Then objDictionary.Add strName, strPath Else objDictionary.Item(strName) = objDictionary.Item(strName) & ";" & strPath End If Next ShowSubfolders objFSO.GetFolder(strStartFolder) For Each strKey in objDictionary.Keys strFileName = strKey If InStr(objDictionary.Item(strFileName), ";") Then arrPaths = Split(objDictionary.Item(strFileName), ";") Wscript.Echo strFileName For Each strFilePath in arrPaths Wscript.Echo strFilePath Next Wscript.Echo End If Next Sub ShowSubFolders(Folder) For Each Subfolder in Folder.SubFolders Set objFolder = objFSO.GetFolder(Subfolder.Path) Set colFiles = objFolder.Files For Each objFile in colFiles strName = objFile.Name strPath = objFile.Path If Not objDictionary.Exists(strName) Then objDictionary.Add strName, strPath Else objDictionary.Item(strName) = objDictionary.Item(strName) & ";" & strPath End If Next ShowSubFolders Subfolder Next End Sub
Thank's for reading the articelScan VBS Script .If You want to copy paste your website please tag my link Scan VBS Script Intro My Website.
0 comments:
Post a Comment