How to overwrite and zip file if exists?


I have created a step to zip my folder into a file.
But soon I realize if I re-run the process, it pops me with “ file already exists” error.

Can robot just overwrite it? Any walk around here?


Instead of overwrite we can delete the already existing file before creating another one
For that place this sequence before you process again
—use PATH EXISTS activity And mention the file path and if it exists it will give us a Boolean value TRUE or FALSE, Get that variable from that activity named bool_fileexists
—now use a IF condition like this
bool_fileexists = True
If true it will go to THEN part where use a DELETE activity and mention the zip file path and the remaining sequence that creates the zip file again
If that fails it will go to ELSE part where we can keep the sequence of creating zip files alone

Hope this would help you
Kindly try this and let know for any queries or clarification
Cheers @Victor_Victory

1 Like

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