I’m a fairly new user and learning as I go on the program.
I have a sequence set up to download a file and then I would like to move it from the “Downloads” folder to another folder location.
However the tricky bit is that the name will be dynamic:
Summary (18)
Summary (19)
Summary (20)
Summary (21)
Summary (22)
Summary (23)
Summary (24)
I’ve tried to read through the forums but there can’t seem to find anything that solves my problem.
I have read that you can’t use an “*” so I’m not sure what else I can try.
Here is what I have:
The above works, but the number 25 will likely change over time.
Thanks for your time and help looking into this one for me.
I’ve run it all bt continue to get this error:
System.IO.IOException: The process cannot access the file because it is being used by another process.
Would you have any idea why that might be?
It can’t be in use as it has just been downloaded.
First finish the downloading process completely.once the files are downloaded completely then run through the loop.You are getting this error because the file is not downloaded yet.
Is that command trying to move every file in my “download” folder? I only want it to move the file downloaded in the sequence - not every file already in there.
Also, not sure if it is pertinent, but it is csv files I am trying to move.
Yes,It will move every file available at that location however you can filter the type of files in the method directory.GetFiles() by using an overload of this method which takes filter in the argument.
Directory.GetFiles(“Directory Path”,“*.csv”)
The issue you are getting while moving the file may be because of the C directory sometimes UIpath does not allow to access the file from the C drive.
Also there can be another reason which i mentioned earlier file should be completely downloaded to the source location then the sequence for moving the file should go next.