DataEase » Support » Knowledge Base » DataEase 7.2 Articles » Delete All Files From a Specific Location

First, create the following CDF:

Function Name: ShellExecuteA
CDF library name: SHELL32.DLL
Return type: Int
Create 6 Parameters:
1-Name: Hndwin Type: Int
2-Name: cAction Type: String
3-Name: cFileName Type: String
4-Name: cParams Type: String
5-Name: cDir Type: String
6-Name: nShowWin Type: String

Close and re-open your DataEase application (to register the CDF).

Copy and paste the following sample DQL code into a new procedure (amend where necessary such as the directories). Compile and run:

define temp “tRet” number .

message “Delete all files from C:\Files? | Click to continue or to cancel” window “Delete Files”; 4; 4; 0 .
if current status = 6 then
tRet := ShellExecuteA(0,”Open”,”cmd.exe”,” /C del C:\Files\*.**”,”C:\Files”, 0) .
end