Move folders from shared location folders to local Machine folder

VJR

Well-Known Member
Hi Mani,

- If you would like to do it in a straight forward way using a Code stage then refer Post # 3 which is for renaming a folder.
Likewise use the below line of code for moving a folder.

Code:
My.Computer.FileSystem.MoveDirectory("C:\Directory1", "C:\Directory2", True)

The last parameter is True if existing directories should be overwritten; otherwise False.

In your case pass the first parameter as an UNC path of the shared folder using the format \\server\sharename.
If you have any access issues then no moving code would work as expected until the access rights issue is resolved.
This will be a permanent action for future reference too.

- Without a code stage you will need to -
- At first 'Create Directory' on your local machine
- 'Get Files' from the shared location
- Move the files from the source to the destination directory
- The files will be moved but the empty directory needs to be deleted
 

CamiCat

Member
Hi Mani,

- If you would like to do it in a straight forward way using a Code stage then refer Post # 3 which is for renaming a folder.
Likewise use the below line of code for moving a folder.

Code:
My.Computer.FileSystem.MoveDirectory("C:\Directory1", "C:\Directory2", True)

The last parameter is True if existing directories should be overwritten; otherwise False.

In your case pass the first parameter as an UNC path of the shared folder using the format \\server\sharename.
If you have any access issues then no moving code would work as expected until the access rights issue is resolved.
This will be a permanent action for future reference too.

- Without a code stage you will need to -
- At first 'Create Directory' on your local machine
- 'Get Files' from the shared location
- Move the files from the source to the destination directory
- The files will be moved but the empty directory needs to be deleted
Hello @VJR ,

how to move each file in the collection given by the Get Files?
Thank you,
Cami :)
 
Top