Moving specific files to another folder

Hello All,

I am trying to move all the zip files from one path “D:\Backup Files” to another path “C:\Users\aamir\Desktop\Updated Files” but i am not able to do i have read many solutions in forum but unfortunately i am not able to move it.
Can anyone please help as this is very urgent requirement and i am not able to move it.

1 Like

Hello @aamir if you can then please upload your xaml so that we can check what went wrong.

Hi,

Please find the attached Workflow.Main.xaml (40.7 KB)

while assigning list use this:
Directory.GetFiles(config.Rows(0).Item(“Path”).ToString,"*.zip")

While moving files use this:

"D:\Backup Files\" & path.GetFileName(item.ToString)

Hi,

Akshay thanks for your help but Directory.GetFiles(config.Rows(0).Item(“Path”).ToString,"*.zip") line is used here just to extract data from one folder and here in this folder there is no .zip file. i am just moving files which is there in this folder and sending it to “D:\Backup Files” folder and then zipping here and then moving the zip file from here back to config.Rows(0).Item(“Path”).ToString.

ok… so whenever you are moving file pass the full path with file name like below:

From Path- “C:/temp/123.txt”
Destination path- “C:/temp2/123.txt”

1 Like

Thank you so much Akhay.
It helped a lot.

Hi…How about if i have different name everyday. I try to use wildcard but it shown an error. Below is the example

From Path :“C:/temp/ID_*.txt”

Destination path:“C:/temp2/ID_*.txt”