Move file error:Could not find a part of the path

Hello community!

Iam trying to move an dbf file from a folder to another folder and i have kept move activity in for each file in folder it is giving me an error could not find a part of the path…and i have given a right path in config.

1 Like

Hi @Priyesh_Shetty ,
Have you check file path exist before move file
Check all path file and folder destination


regards

@Nguyen_Van_Luong1

Hello!

Actually bot is downloading a zip files and it is extracting that zip in a dedicated folder file name keeps changing daily when iam running the bot…so for that i have used for each file in folder and i have ticked the option include subfolder…
So inside that extracted folder it contains dbf file i want that files to be moved to another location.

@Priyesh_Shetty

can you check it once manually whether source and destination folders are Present and source folder is having files or not

@Shiva_Nikhil

I have checked and the extracted folder is not present in the path actually when though i have given a correct path for extraction then to the extracted folder is not present.

Yes, I see
Yes I see, we can get name of zip download file
we can get extracted folder name
we can use for each file in folder extracted
check if file contain “*.bdf”
move it

But firstly you need check download success, file zip existed, folder extracted existed, extracted zip done
regards,

@Nguyen_Van_Luong1 @Shiva_Nikhil

I have checked manually extracting the zip file actually the zip file is corrupted so how i can handle the exception and mail the user that this files are corrupted?

You can check path exist to check it download success or not
if download success by “path exist”
you can check folder extracted after extract, it extract success or not by “path exist”
check extracted folder empty or not by count file in folder by “get file in directory”
Regards,

@Nguyen_Van_Luong1 i have used path exist and iam performing the process


Above attached is the dbf file when the condition is going in then part to move the file then also iam getting same error move file could not find a part of the path

@Nguyen_Van_Luong1

Hi,

while moving the file to the destination folder, check destination folder exists.
if yes move file
if no create folder, then move.

Try to log folder path in log message and also folder existing or not. so that you will get idea where the files are moving.

try to apply this logic and see!

have you checked your destination path
could you show what’s error at this activity, once of them not correct
regards

@Priyesh_Shetty

  1. Log the filepath of you destination
  2. Use cureentfile.DullName that is more intuitive

Cheers

@Anil_G @Shiva_Nikhil


Same error

@Priyesh_Shetty

can you try by removing

\

which is at last

@Shiva_Nikhil

When iam creating a test xaml and just moving the file then it is working.

@Shiva_Nikhil
I tried but same issue.

@Priyesh_Shetty

can you check the path in immediate panel which you have passed in the To path

out_config(“YourKey”).tostring

@Shiva_Nikhil

Actually In for each file folder iam passing extract/unzip folder variable in In folder…And actually the process is bot is donwloading zip from email and it is extracting in a dedicated folder and that zip file contains dbf file after that i want to move that file in a different folder.

@Shiva_Nikhil


After downloading this zip it is like this.