web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Empty Folder Action error
Power Automate
Unanswered

Empty Folder Action error

(0) ShareShare
ReportReport
Posted on by 74

Hi, all of a sudden I am getting error message in PAD Can't delete folder C:\XXXX\XXXXXXX.

 

First iteration with this line runs fine, second time doesnt.  Trying once again with a restart has the same problem.  If i close down PAD it will suddenly re-work ONCE.

 

Access to the path 'C:\XXXXX\XXXXXXX\Image1.jpg' is denied. is the messgae I get against Empty Folder.

 

Other method "delete files" doesnt work either.  Any thoughts?  Please advise what further details i need to share.  thanks!

  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    May be that specific file would require permission to delete it. can you delete the file manually ?

  • tbang3000 Profile Picture
    74 on at

    Hi, yes i was able to delete all thefiles manually.

  • tbang3000 Profile Picture
    74 on at

    Actually!!! i now get an error trying to delete saying "the action can't be completed because the file is open in COM Surrogate".  I mustve got lucky last time i deleted.

     

    Any thoughts?

  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    Hi @tbang3000 

    Did you google "COM Surrogate"?

    If no, try now and if this is corporate/company computer reach out to your IT as it might be infected 😉

    If personal scan with some malware software

     

  • tbang3000 Profile Picture
    74 on at

    @momlo COM Surrogate is apparently a vital Windows 10 component that yuo cant just shut down...  have run ccleaner and have a AV scanner running jsut in case, but seems to be still thinking its still open?  I use the file in a loop, then am finished with it.  Maybe it suddenly thinks its still open when all i am doing is uploading the file... it finishes the job but somehow is still in use.  seems also to be only the first file in a group of 4-5 photos thats the issue too... the others i can delete fine.

  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    yeah, that's why recommended to scan as if this process runs from an unusual location and activates on file access - it is very often a sign of infection. But tath's what you need to investigate. 
    You can upload the DLL (check the path in Task Manager) to VT to see what it tells you.

    https://www.virustotal.com/gui/home/upload

     

    Assuming this is a genuine process what you can do to try to workaround is to configure "on error" to repeat the attempt to empty the folder, so if first attempt fails due to file being locked - wait x seconds and try again.

     

     

     

     

  • tbang3000 Profile Picture
    74 on at

    thanks @momlo...  no viruses.   I can see COM Surrogate appear as soon as browser loads. The problem does go away if I end the task in task manager manually.  Perhaps there's the ability to end tasks as part of the loop?  SHouldnt have to though.  This is definitely a new problem for existing steps that was never a problem before..

  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    you can use action to kill the process, you can use as another one in th loop

    should help until you find root cause, this process is a "bag of everything and nothing" to group to other stuff so you never know what you will be killing there

     

  • tbang3000 Profile Picture
    74 on at

    this is driving me nuts.. if anyone else has any ideas.. i still have the problem... loop to wait until the COM Surrogate use is cleared is taking too long for the process required... 😞

  • tbang3000 Profile Picture
    74 on at

    FYI for anyone reading this in the future, i figured it out.    UPDATE YOUR BROWSER!!  Its becuase your browser is not up to date.  Done this, fixed the problem. COM surrogate is not necessarily a virus.  thank you!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard