Move folder from one location to other

I need to move folder from one to another .

Say : SaveAttachment folder [bot will create all the time] and move it to other folder say Backup at the end of process completion.

In Backup folder i want to move SaveAttachment folder with the time stamp so that already existing scenario can be avoided. Please guide me how can i do this.

Thanks.

1 Like

Thanks Karthik, but this didn’t work because this will be not one time activity . i need to move the folder again and again to this destination and name will be same… So it won’t allow me to do that since it will throw error with already exist name.
Adding to it, this sample moves only files but not complete folder .

Can you please help me move complete folder to other location .

Regards

In Move file activity, give the destination as full file path with time stamp.

Eg: Destination: “D:\Destination” + Now.tostring(“ddMMyyhhmmss”) + “. file extension”

i want to move complete folder into some other folder. and even i want to append time stamp to the source folder so that i can avoid folder already exist scenario.

Please help me on this , entire day i tried but no success…

Thanks

To copy the whole folder use Invoke Powershell activity in Command Text give “Move-Item” and add two parameters Path (the folder you want to copy) and Destination (the folder where you want to copy the folder).
image

2 Likes

And to rename you can still use powershell. Find attached an example workflow
Move_and_rename_folder.xaml (5.6 KB)

4 Likes

Thank you , it worked. just one more help- how can i append time stamp to source folder when we move it to destination.?

Thanks

Hi @Tabish_Faridi.

First I would suggest using the Move Directory activity created by vv which can be found in the Community Feed. You can’t use the Move File on Folders. There are probably other ways to move the folder too like Powershell which was suggested.

If you use the activity “Move Directory”, first make sure you have the Community Feed. Follow below screenshots:
Right Click on Available and add in the source for Community Feed:
image

image

Then, go search for Move Directory activity:

Now, you can add this activity in and change the From and To Properties:
image

For Dest/Destination, use the same folder as your Src/Source but add the timestamp, like @Vivek_Arunagiri showed:

sourceFolder + " " + Now.ToString("yyyyMMdd.hhmmss")

I hope this gets you in the right direction!

Regards.

Set the destination like shown above where sourceFolder is the same folder name that you are moving.

Hope the quick reply helps. :smiley:

1 Like

Awesome…:+1:

Thank you.

I’ll also quickly add that the reason I formatted your timestamp with the year first is so when you sort the folders, they will sort by year. :slight_smile:

1 Like

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