Delete All Files In Folder - Forum

Forum Navigation
You need to log in to create posts and topics.

Delete All Files In Folder

Hi guys.... how do I delete all files in a Folder with button script? Doesn't matter what extention (.txt .exe .jpg etc) are in it. It must remove all the files in the Folder.

Thank You

A small example.

https://yadi.sk/d/jKnDBR27biLE6g

Regards

Andrei  (as3856).

Hi as3856...

Thank You for the example. I also know how to delete each file the same way as your example, but I thought there was another way. It would be better for me to Delete the Folder then and to Create a new Folder again. Think luishp and the team should think about a Action script to Clear a Folder in there next update.

Example: ClearFolder "[PubDir]NameList" "All"

Greetings

You had a question about deleting files - my example deletes all the files in the folder, and if there are subfolders, they will not be deleted. Your answer is that you can delete the entire folder, and then create the same incorrect. , since other folders can be located in the deleted folder as well. Creating the update command to delete all files of the folder is considered superfluous, but adding some components (objects) would be nice - there are many different components in Delphi that would be useful in VisualNeo.

Regards

Andrei (as3856).

NeoDouble plugin

You can try using Windows CMD:

Run "del" "[PathName]\*.* /Q" "Wait+Hidden" "" ""

For more command line atributes for "del" command take a look here:

https://www.computerhope.com/delhlp.htm

Best regards.

Thank you guys for the help. The one from luishp is just what I needed.

Regards

@echo off
REM (Remove app files and their folder.)
RMDIR "MyFolder" /S /Q
exit

above as a DOS batch file

Open chat
1
Do you need more info?
Hi, do you have any doubt?