How to move all files in a folder to another folder

Run your attached source code, it only can move files to dest. but the folders or directories under is can not be able to move

One simple way which will avoid lines of code is to Move the Entire folder (files and subfolders) and Recreate the Source folder.

1 Like

this is a quick way but not good for existed folder, Maybe we should use recursive method

Yeah if it has any kind of sharing persmissions.

Hi vikas,

Can you please tell me, how to read a file in excel application scope, dynamically?? (File name will change every time)


Please refer this

Vikas Reddy

1 Like

Hi @vikas_reddy_Vicky,

but i have to read only one excel at a time(after reading excel is moved into other location), like that may be 20 in a day . Each file name will be different

Hi Venkatesh,

so you have file names in string array (achieved this by using Directory.Getfiles)
now use ‘excel application scope’ inside ‘for each’ loop and pass the file names as variable.

Please let me know if you want any xaml for reference.

Vikas reddy

1 Like

throughout the day, files will come. we dont know, when it will come. once it is read, it is moved into another folder.

Hi , @vikas_reddy_Vicky , @badita

I’m using Invoke Method to move folders. But i’m getting ‘access to the path is denied’ when i’m using it.

But i;m able to move folders manually


I’m trying to do a backup of files in a folder and using move activity.

for the property ‘path’ I’m using the directory where the file is located as “D:\folder1\folder 2”

for the property ‘destination’ I’m using the directory where the file is located as “D:\folder1\folder 2\Backup_MMDDYY\abc.txt”

I’m trying to find if a file named “abc.txt” exists in the directory “D:\folder1\folder 2”, If so I’m creating a new directory in “D:\folder1\folder 2” as “D:\folder1\folder 2\Backup_MMDDYY” and trying to move that file to the new directory “D:\folder1\folder 2\Backup_MMDDYY\abc.txt”

I don’t see any error but the file is not moved to the directory.

Any clue ?

“I resolved it” – Thanks.!

Can’t get this to work.
Just getting the error message “Directory does not have a public static method named “Move” matching the parameter types, generic type arguments, and generic type constraints supplied in the InvokeMethod”

Can you please attach a workflow showing the correct setup?

Hello folks,

Whiile I am trying to use invole method it was showing like “Directory does not have public static method named Move directory”. Could any one suggest how can I avoid this error.