Extract zip file

I have a few files in a folder. they can be xlsx, pdf, txt and zip file. I have move the files from this folder to another. say there are approximately 500 files
I am using if condition looking at each file in the folder, if it is zip then i am using extract/unzip files activity else just move using Move File activity.
It is getting complicated as i am not able to move the zip files that is password protected. I do not want to extract and move if the zip file is password protected and want to if it is not password protected.

I am new to UiPath, can you assist on how to solution this.

You can wrap extract zip activity within try catch, zip files with password will throw an error, you can catch in catch block and then move files to error folder i.e zip files with passowod

Hi @veeresh.p

use For Each file → If file is zip, try Extract/Unzip in Try Catch → if extraction fails (exception), move the zip as is; else move extracted files. Non-zip files, use Move File.

If helpful, mark as solution. Happy automation with UiPath

Hi,

Can you try the following sample?

Conditions

exception.InnerException isnot Nothing AndAlso exception.InnerException.Message.ToLower.Contains("encrypted")

Sample
Sample20260108-1.zip (5.3 KB)

Regards,

Hi All,

Thank you for your response. I did used below flow and it worked.
Shabbir, Prashant and yoichi thanks for your suggestion.
For each file folder
If extension of file is zip
try
unzip file
catch
log message = File + “is not processed”
end try
End if
next file