How to move files from source to destination folder in Blueprism?

0 votes
Mar 19 in RPA by anonymous
• 160 points
112 views

1 answer to this question.

0 votes

Try this approach. It creates a new folder in the destination with the same name as the source folder, copies its contents, and deletes the source folder (essentially the same thing as moving it). The inputs remain Folder_Path and Destination.

Success = True
Message = "" 

Try
    If Not Folder_Path.EndsWith("\") Then
        Folder_Path &= "\"
    End If

    Dim newDirectory As String = System.IO.Path.Combine(Destination, Path.GetFileName(Path.GetDirectoryName(Folder_Path)))
    If Not (Directory.Exists(newDirectory)) Then
        Directory.CreateDirectory(newDirectory)
    End If
    Microsoft.VisualBasic.FileIO.FileSystem.CopyDirectory(Folder_Path, newDirectory)
    System.IO.Directory.Delete(Folder_Path, True)

Catch e As Exception
    Success = False
    Message = e.Message
End Try

Ensure that you include the System.IO namespace in the Code Options of your object. The Code Options can be found by double-clicking the description box on the Initialize Page/Action and choosing the appropriate tab.

answered Mar 20 by liana
I'm new to Blue Prism...I've tried your approach but its showing me some errors can u kindly give me more details about the code stage part and also where to include that code that you've mentioned, Is it in the code stage?

Yes, and also could you post the errors that you are getting? It will be easier to comprehend the query.

Related Questions In RPA

0 votes
1 answer

How to move all files from Source to Destination Folder in UiPath?

Hi Pragati, in order to move files ...READ MORE

answered Mar 7, 2019 in RPA by Abha
• 27,800 points
1,668 views
0 votes
1 answer

How to move folders containing Json and Images files to another folder in uipath?

Hey Akshay, you can check this thread ...READ MORE

answered Jun 3, 2019 in RPA by Abha
• 27,800 points
224 views
0 votes
2 answers

How to configure outlook automation in Blueprism

Mapiex works only with 32bit outlook client ...READ MORE

answered Dec 7, 2018 in RPA by Nitesh
8,606 views
0 votes
1 answer

What is code segment in Blueprism and how to implement it?

Blue Prism - Code Stage The code stage ...READ MORE

answered Sep 28, 2018 in RPA by Priyaj
• 57,530 points
2,516 views
0 votes
2 answers

How to resolve busy resource in BluePrism to run a process in the control room?

Did you manage to resolve this problem ...READ MORE

answered Jul 2, 2019 in RPA by Tim
1,428 views
0 votes
1 answer

How to resolve busy resource in BluePrism to run a process in the control room?

the most common cause of that error ...READ MORE

answered Oct 9, 2018 in RPA by Priyaj
• 57,530 points
1,134 views
0 votes
1 answer

RPA : How to extract specific data from scanned pdf and write into excel in blueprism?

Your query is similar to https://www.edureka.co/community/65092 ...READ MORE

answered Mar 23 in RPA by Sirajul
• 50,440 points
76 views
+2 votes
1 answer

UIPath - Extract Table data from PDF Image

There are mainly two options that UiPath, ...READ MORE

answered Mar 20 in RPA by anonymous
• 50,440 points
717 views