Moving PDF's from download folder to another folder

I am using Move file activity and iam moving all the pdf’s from download location to PDF folder location…Sometimes bot just leave on pdf file in download location and rest all pdf’s get moved…I have added delay also then too its happening…Anyone can tell me what is the issue?

Hi @Priyesh_Shetty1

Can you try this approach:

  1. Get all the PDF files in the download file in an array. Do this by using an Assign activity:

pdfFiles = Directory.GetFiles(downloadFolderPath, "*.pdf")

  1. For Each file in this array, use the Move File activity to move the file from the download folder to the PDF folder.

Hope this helps,
Best Regards.

I have done this same method with help of for each iam moving the file


But still not able to move the files? Can you please share the screenshot of the downloads folder or any error you are getting?

Also, apply the breakpoint before the for each & check if the array has all the file names that were supposed to be moved.

Best Regards.

In this PDF files are getting moved but most of the time one file is not moved by the bot.


Ideally that should not happen…are you downloading the pdf and then immediately this loop?

may be before download you are trying to do get files and the pdf extension will be different while downloading so may be it is not picked


are you moving the files too soon? I had a similar problem. I had moved the files before the download was complete.


Use wait for download activity, then use the move file activity on recently downloaded files like below.

Directory.GetFiles("Downloadpath","*.pdf").OrderByDescending(Function(x) new FileInfo(x).CreationTime).First

Happy automation

@Manju_Reddy_Kanughula it is showing error after using ur method…And i want to move multiple pdf’s files and all files are getting moved except one file which is 892 kb file only this file is not getting rest all are getting moved!

no after downloading specific files, after that i have added a delay then iam moving the files.

@Anil_G first Bot is downloading all the required pdf files then i have added delay after that,then bot is moving the files from one folder to another folder.


Did you use wait for download activity?


No how to use that?


After whatever click the downlaod happends include a wait for downlod activity…and then includethe final click in that activity and monitor the folder will be the folder in which you downlaod the folder. So the bot would wait till file is downloded


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