Showing results for 
Search instead for 
Did you mean: 
Super User
Super User

File System Actions - information for locked files?

I have learned that I am unable to perform a Delete File action when it is open.  Unfortunately, this is a shared drive, and I have no way to police who has files open in this directory.  I have been looking, but have not found anything in the metadata actions that would tell me if the file is locked nor by whom.  I would like to test this first, and trigger a notification to the user to close the file.  


I know that I can Configure Run After to do things on the failure of the delete, which I will do at a minimum, but I would like to have the user info so I can know who to harass to have them close the file.  


Any ideas?


Thank you.

Super User
Super User

Re: File System Actions - information for locked files?

I can't think of any easy way to accomplish this, other than capturing when a delete fails in something like a SharePoint list for reviewing later.

You could create a SharePoint list from the failures then utilize a Scheduled Task to run the force-close script against the list - but that would operate outside of Flow (Close-SmbOpenFile).

The File System operations for the Gateway Connector has pretty limited actions, triggers and definitions. You're basically limited by the BlobMetadata definition, which has a LastModified, but not a modified or opened by. 

If this is functionality you would like to see added to Flow, please consider submitting it to the Flow Ideas page, where it can be voted on by other users, and tracked and commented on by the Flow team.

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources


Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!


Microsoft Learn

Learn how to build the business apps that you need.


Power Platform World Tour

Find out where you can attend!


Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 289 members 4,715 guests
Please welcome our newest community members: