# How to call SHFileOperation API to recursively delete files and folders

**URL:** <https://clarionhub.com/t/how-to-call-shfileoperation-api-to-recursively-delete-files-and-folders/5172>\
**Category:** questions\
**Tags:** c6, winapi\
**Created:** [June 3, 2022, 2:04pm UTC](https://clarionhub.com/t/how-to-call-shfileoperation-api-to-recursively-delete-files-and-folders/5172 "2022-06-03T14:04:52Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![CarlBarnes](https://clarionhub.com/user_avatar/clarionhub.com/carlbarnes/32/1859_2.png) [@CarlBarnes](https://clarionhub.com/u/CarlBarnes)\
**Post date:** [June 3, 2022, 9:30pm UTC](https://clarionhub.com/t/how-to-call-shfileoperation-api-to-recursively-delete-files-and-folders/5172/4 "2022-06-03T21:30:05Z")

</div>

This example on GitHub uses all Clarion code (e.g. DIRECTORY) to recursively load files into a Queue and display in a LIST. It does a Rename on files but you could change it to do a DeleteFile() or Remove(). You get a Window with a Progress bar.

You can remove the link and call to SHAutoComplete() which is used to auto fill the folder.

> **[GitHub - CarlTBarnes/Zip-FileName-Fixer: Fix File Names by Removing Characters Rejected by...](https://github.com/CarlTBarnes/Zip-FileName-Fixer)**
>
> Fix File Names by Removing Characters Rejected by Zip

Be careful with SHFileOperationA() as sending it bad parameters may delete the wrong stuff, like your project or everything.

---

_[View the full topic](https://clarionhub.com/t/how-to-call-shfileoperation-api-to-recursively-delete-files-and-folders/5172)._
