How to delete a file by searching folders?
-
- Posts: 53
- Joined: Fri Dec 30, 2022 2:43 am
How to delete a file by searching folders?
Hello oleg. as an example I have a file called: test file.mp3, which is located in several subfolders, which task do I use for, look for the test file.mp3 in these folders and delete them? and also using parts of the file name such as: test*.mp3... thank you friend
-
- Posts: 53
- Joined: Fri Dec 30, 2022 2:43 am
Re: How to delete a file by searching folders?
This doesn't work thenanthonyystwarty wrote: ↑Fri Sep 08, 2023 11:28 pm Hello oleg. as an example I have a file called: test file.mp3, which is located in several subfolders, which task do I use for, look for the test file.mp3 in these folders and delete them? and also using parts of the file name such as: test*.mp3... thank you friend
Re: How to delete a file by searching folders?
Hello, I believe a good solution to this would be to do a File Loop action that uses the file path of the parent file so an example would be "C:\Users\Person\Desktop\Robotask\test file.mp3" and include other iterations of the name as well if there is and in the task do "Assign Current Filename to Variable:" to be a variable. I used "FILENAME" as my variable and select the box "Without Full Path". Also do the look kind "By Files Only". After that, in the file loop add the Delete File Action that uses that File path above but with the variable "FILENAME" at the end so that it changes depending on the name of the file from the file look.