Report write to file doesn't overwrites

I'm trying to overwrite an existing file on the Script Console.
It doesn't throws any errors.
It doesn't work until I erase manually the original report file on Windows.
Same thing happens on the Report schedule actions when using save file or scripting a system.file.saveFile() function.

Any help please?

settings = {
"path":"D:\Reports\",
"fileName":"Report_test.jpg",
"format":"jpg"}

system.report.executeAndDistribute(
path="KPI/ReportTV", #my report path
project="ScadaYBF", #my project
action="save",
actionSettings=settings)

Given that this is happening both with reporting and system.file.saveFile(), I suspect it might be a Windows permission issue.

1 Like

Thank you!