How to Delete all files & all folders in a specific directory

Please give me sample .xaml how to Delete all files & all folders frmo a specific directory.
Thanks.

Hey @afrizal

You can check this Existing Thread - How to delete multiple files

Regards…!!
Aksh

Hey @aksh1yadav

It’s only delete all files, but not for folders.
I want it to delete both all files and folders in a specific directory.
Thanks.
Regards,
Afrizal

For Directory Look This - Trouble with invoke method - #3 by aksh1yadav

Regards…!!
Aksh

Here is a detailed article on that :slight_smile:

hi @afrizal
Below line gets all directories ,

Directory.GetDirectories(folderPath)

loop through all directories and delete.Attached the xaml file FYI

Thank You

DirectoryDelete.zip (13.5 KB)

Hello Afrizal,
In this video I do a lot of stuff with Files:

1:10 Download the file and Move the latest file to folders
4:30 Rename files with VB commands
6:00 Move files to do Rename
6:55 Delete files
8:15 Delete only PNG files
8:55 Delete all the files except PNG files
9:55 Move files
11:10 Delete files that are older than 2 weeks
Thanks,
Cristian Negulescu