cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jlaviolette
Frequent Visitor

Illegal characters in path

Im trying to build a flow to delete files older than 550 days, but i cannot seem to even get it to delete a test file from a test folder with no conditions.

 

Get files in folder - output to variable "Files"

Delete Files - "Files"

 

Microsoft.Flow.RPA.Desktop.Modules.SDK.ActionException:

Can't delete file C:\Users\james\Desktop\Data FolderC:\Users\james\Desktop\DataFolder\76543.txt ---> System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.Path.GetFileName(String path)
at Microsoft.Flow.RPA.Desktop.Modules.File.Actions.DeleteFileAction.Execute(ActionContext context)
--- End of inner exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.File.Actions.DeleteFileAction.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

 

i highlighted in red the only thing i can think of that could be wong, maybe there should be a space there? i have no idea...

im pretty new to this and this is quite frustrating, if you can help, please let me know!

1 ACCEPTED SOLUTION

Accepted Solutions
eliotcole
Super User
Super User

I think that's two paths that have been joined together, @Jlaviolette ... I might not be the person who answers this, but if you include screenshots of your flow, and maybe some example data in a code box, then folks might have a better chance of assisting you, mate. 👍

 

Just obfuscate anything sensitive, and ensure that it's all in the original question, as that helps folks in the future parse what's going on. 🙂

 

View solution in original post

2 REPLIES 2
eliotcole
Super User
Super User

I think that's two paths that have been joined together, @Jlaviolette ... I might not be the person who answers this, but if you include screenshots of your flow, and maybe some example data in a code box, then folks might have a better chance of assisting you, mate. 👍

 

Just obfuscate anything sensitive, and ensure that it's all in the original question, as that helps folks in the future parse what's going on. 🙂

 

yes! so i had been putting the file path in as well as the variable and it turns out all i needed was the variable itself.
its working now.
now i still need to figure out how to only delete files older than 550 days

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (1,923)