How to move only specific name zip file's to destination path?

Hello community!

How can i move specific zip files to destination path
example-{CAMS,KARVY,NDML,BSE,DOTEX,CVLKRA}
above example name are zip files which i want to move but sometime some files are not available to move?
I want bot should only move above example named files if it found…It should not move any different zip files.

Hi @Priyesh_Shetty1


sourceFolderPath As String = "C:\SourceFolder"
destinationFolderPath As String = "C:\DestinationFolder"
zipFileNames As String() = {"CAMS.zip", "KARVY.zip", "NDML.zip", "BSE.zip", "DOTEX.zip", "CVLKRA.zip"}
 filesInSourceFolder As String() = Directory.GetFiles(sourceFolderPath)
For Each filePath As String In filesInSourceFolder
    fileName As String = Path.GetFileName(filePath)
    If zipFileNames.Contains(fileName) Then
        MoveFile Activity
           (filePath, Path.Combine(destinationFolderPath, fileName))
    End If

Hope it helps!!

@Priyesh_Shetty1,

Try with this xaml, it may help you.
GetFilesContainsString.xaml (5.0 KB)

For Each in yourArray(string)

  • If File.Exists(Path.Combine(yourBasePath,item + “.zip”))
    ** Move File Path.Combine(yourBasePath,item + “.zip”)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.