Page 1 of 1

How to delete a file using a wildcard inside a specific folder? (File Loop not returning results)

Posted: Fri Nov 28, 2025 4:38 pm
by anthonyystwarty
Hello Oleg, how are you?
I’m trying to delete a file inside a specific folder using a wildcard in RoboTask, but I can’t make the File Loop return any results.

Here is the scenario:
I have a folder like this:
C:\Radio Indoor\Supermercado\Depieri Oficinas\Playlist\pgm\Materiais\_Comerciais\_Tapa BURACO\

Inside this folder, there is one file, but the extension may change:
sometimes it is .mp3, sometimes .wav.
The file name always contains this text:
RODAR SABADO

For example:
SUP DEPIEIR BLACK PARA RODAR SABADO 30-11-25.mp3

I want RoboTask to delete this file automatically, regardless of the extension.
What I already tested:

Delete File alone with this mask works perfectly:
C:\...\_Tapa BURACO\*RODAR SABADO*.*

This deletes the file correctly.
But when I try to use File Loop like this:
Search for Files:
C:\...\_Tapa BURACO\*RODAR SABADO*.*

And assign the filename to a variable, RoboTask does not find anything.
The Delete File action inside the loop never runs.
I tried:
“By Files Only”
“By Folders Only”
With and without “Include Subfolders”
With and without “Without full path”
Using variables
Using “FileList()” to check results
Nothing makes the File Loop return the file.
However, Delete File alone works, which means the wildcard and the path are correct.

My question:
Is it possible to use File Loop to catch files using masks like *RODAR SABADO*.* inside a specific folder?
Or does RoboTask handle this type of wildcard only directly in Delete File?
If it is possible, can you show the exact configuration for File Loop to detect and return the file?

Thank you very much!
Cloves

Re: How to delete a file using a wildcard inside a specific folder? (File Loop not returning results)

Posted: Fri Nov 28, 2025 6:17 pm
by Oleg
I created the folder:
"C:\Radio Indoor\Supermercado\Depieri Oficinas\Playlist\pgm\Materiais\_Comerciais\_Tapa BURACO"
and created a few files in this folder:
SUP DEPIEIR BLACK PARA RODAR SABADO 27-11-25.mp3
SUP DEPIEIR BLACK PARA RODAR SABADO 28-11-25.mp3
SUP DEPIEIR BLACK PARA RODAR SABADO 29-11-25.mp3
SUP DEPIEIR BLACK PARA RODAR SABADO 30-11-25.mp3


1-st example. Use the "File loop"

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1133661666
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DisableOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task86"
Hide=INTEGER|0
ID=INTEGER|1293737990
LogOnAsUser=INTEGER|1
Name=STRING|"Collect files *RODAR SABADO*.* in search for files"
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RestrictRESTAPIAccess=INTEGER|0
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
StepPause=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""_folder"" with value ""C:\Radio Indoor\Supermercado\Depieri Oficinas\Playlist\pgm\Materiais\_Comerciais\_Tapa BURACO"""
Params=FOLDER

[Actions\Action1\Params]
_rt_variables_produced=STRING|"_folder"
expand=STRING|"0"
linecount=STRING|"1"
varname=STRING|"_folder"
varvalue=STRING|"C:\Radio Indoor\Supermercado\Depieri Oficinas\Playlist\pgm\Materiais\_Comerciais\_Tapa BURACO"

[Actions\Action2]
ActionID=STRING|"A_FILE_SEARCH"
Enabled=INTEGER|-1
Name=STRING|"Create File List (variable: _list)"
Params=FOLDER

[Actions\Action2\Params]
_rt_variables_produced=STRING|"_list"
After=STRING|"0"
aftercount=STRING|"0"
AfterLine=STRING|"0"
Before=STRING|"0"
beforecount=STRING|"0"
BeforeLine=STRING|"0"
createmode=STRING|"1"
date1=STRING|"20251128"
date2=STRING|"20251128"
destvar=STRING|"_list"
DuringDays=STRING|"1"
DuringHours=STRING|"1"
DuringMinutes=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"{_folder}\*RODAR SABADO*.*"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderHours=STRING|"1"
OlderMinutes=STRING|"1"
OlderMonths=STRING|"1"
savetofile=STRING|"0"
savetovar=STRING|"1"
searchkind=STRING|"0"
sort=STRING|"0"
sortby=STRING|"0"
sortorder=STRING|"0"
subdirs=STRING|"1"
WithoutPath=STRING|"0"

[Actions\Action3]
ActionID=STRING|"A_LOG_DIALOG"
Enabled=INTEGER|-1
Name=STRING|"Log Dialog"
Params=FOLDER

[Actions\Action3\Params]
line00000000=STRING|"{_list}"
linecount=STRING|"1"
It works. I get the result:

Code: Select all

28.11.2025 19:12:30; C:\Radio Indoor\Supermercado\Depieri Oficinas\Playlist\pgm\Materiais\_Comerciais\_Tapa BURACO\SUP DEPIEIR BLACK PARA RODAR SABADO 27-11-25.mp3
28.11.2025 19:12:30; C:\Radio Indoor\Supermercado\Depieri Oficinas\Playlist\pgm\Materiais\_Comerciais\_Tapa BURACO\SUP DEPIEIR BLACK PARA RODAR SABADO 28-11-25.mp3
28.11.2025 19:12:30; C:\Radio Indoor\Supermercado\Depieri Oficinas\Playlist\pgm\Materiais\_Comerciais\_Tapa BURACO\SUP DEPIEIR BLACK PARA RODAR SABADO 29-11-25.mp3
28.11.2025 19:12:30; C:\Radio Indoor\Supermercado\Depieri Oficinas\Playlist\pgm\Materiais\_Comerciais\_Tapa BURACO\SUP DEPIEIR BLACK PARA RODAR SABADO 30-11-25.mp3
Then I created 2-nd example. Use "Search for files"

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1133661666
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DisableOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task86"
Hide=INTEGER|0
ID=INTEGER|1293737990
LogOnAsUser=INTEGER|1
Name=STRING|"Collect files *RODAR SABADO*.* in search for files"
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RestrictRESTAPIAccess=INTEGER|0
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
StepPause=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""_folder"" with value ""C:\Radio Indoor\Supermercado\Depieri Oficinas\Playlist\pgm\Materiais\_Comerciais\_Tapa BURACO"""
Params=FOLDER

[Actions\Action1\Params]
_rt_variables_produced=STRING|"_folder"
expand=STRING|"0"
linecount=STRING|"1"
varname=STRING|"_folder"
varvalue=STRING|"C:\Radio Indoor\Supermercado\Depieri Oficinas\Playlist\pgm\Materiais\_Comerciais\_Tapa BURACO"

[Actions\Action2]
ActionID=STRING|"A_FILE_SEARCH"
Enabled=INTEGER|-1
Name=STRING|"Create File List (variable: _list)"
Params=FOLDER

[Actions\Action2\Params]
_rt_variables_produced=STRING|"_list"
After=STRING|"0"
aftercount=STRING|"0"
AfterLine=STRING|"0"
Before=STRING|"0"
beforecount=STRING|"0"
BeforeLine=STRING|"0"
createmode=STRING|"1"
date1=STRING|"20251128"
date2=STRING|"20251128"
destvar=STRING|"_list"
DuringDays=STRING|"1"
DuringHours=STRING|"1"
DuringMinutes=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"{_folder}\*RODAR SABADO*.*"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderHours=STRING|"1"
OlderMinutes=STRING|"1"
OlderMonths=STRING|"1"
savetofile=STRING|"0"
savetovar=STRING|"1"
searchkind=STRING|"0"
sort=STRING|"0"
sortby=STRING|"0"
sortorder=STRING|"0"
subdirs=STRING|"1"
WithoutPath=STRING|"0"

[Actions\Action3]
ActionID=STRING|"A_LOG_DIALOG"
Enabled=INTEGER|-1
Name=STRING|"Log Dialog"
Params=FOLDER

[Actions\Action3\Params]
line00000000=STRING|"{_list}"
linecount=STRING|"1"
It works too. I get the result

Code: Select all

28.11.2025 19:14:33; C:\Radio Indoor\Supermercado\Depieri Oficinas\Playlist\pgm\Materiais\_Comerciais\_Tapa BURACO\SUP DEPIEIR BLACK PARA RODAR SABADO 27-11-25.mp3
C:\Radio Indoor\Supermercado\Depieri Oficinas\Playlist\pgm\Materiais\_Comerciais\_Tapa BURACO\SUP DEPIEIR BLACK PARA RODAR SABADO 28-11-25.mp3
C:\Radio Indoor\Supermercado\Depieri Oficinas\Playlist\pgm\Materiais\_Comerciais\_Tapa BURACO\SUP DEPIEIR BLACK PARA RODAR SABADO 29-11-25.mp3
C:\Radio Indoor\Supermercado\Depieri Oficinas\Playlist\pgm\Materiais\_Comerciais\_Tapa BURACO\SUP DEPIEIR BLACK PARA RODAR SABADO 30-11-25.mp3
I think that the problem is in your tasks.