How to delete all files from directory

Hi,

I want to delete one or more image files from the Project Directory.
image
As attached in image I have to delete one or more image present in the directory. in my case 1.jpg is there.For deletion address should be DYNAMIC not full address should be there.

Thanks

Hi @mnk ,

To achieve the requirement you have to follow below work flow.

  1. We have to use two for each loops one for to get the Directories or folders from the main directory and second for each loop to get the file from the specific folder.

  2. Inside second for each loop you have to use delete file activity to delete the image file(.jpg)

Please refer the below screenshot for your reference. And also attached sample work flow for your reference. i hope it might guide you to achieve your requirement. thanks.

Please note that since we are dealing with our Uipath project folders. Could you pls take backup before performing or testing these operations. thanks.


DeleteImagesDemo.zip (3.8 KB)

@kirankumar.mahanthi1 Thanks That worked.

Your welcome @mnk

@kirankumar.mahanthi1 I am having one question If i want to save image using (save as ) option then how we make path dynamic for it.
Any idea.

Thanks

Hi @mnk,

for example instead of deleting your file with delete file activity instead Use Copy file activity and input should be Item.tostring and destination should be your foldername+newfilename with extension. Please refer the attached work flow for your reference. thanks

Save As Images Demo.zip (2.5 KB)

@kirankumar.mahanthi1 Thanks for your time ,LikeHere is mytask is to take PPt edit it and then Save it as JPEG format using Save as like this

image

Then This saved file, I have to share through Outlook email.

Thanks

Hi,

There are couple of ways.

One is we have to proceed with ui automation which you are showing and save as the PPT file to image.

Another way is we have to use invoke code activity to convert PPT to image.

since never tried please post his question as different topic so that our forum members could guide you more better way. thanks.

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