Okay. I will give you a function. This function remove all files from directory.

Code:
int iffile_exist(char* fileName) 
{
	long fileAttr;
	fileAttr = GetFileAttributes(fileName);
	if (0xFFFFFFFF == fileAttr)
	return 0;
	return 1;
}

STRING* str_temp="";
STRING* str_folder_temp="";
WIN32_FIND_DATA file_handle;
HANDLE FolderHandle;

function remove_all_files_fromfolder(STRING* folder)
{

	str_cpy(str_folder_temp,folder);
	str_cat(str_folder_temp,"*.*");//all files

	FolderHandle = FindFirstFile(_chr(str_folder_temp),&file_handle);
	if ( INVALID_HANDLE_VALUE == FolderHandle ) 
	{
		printf("No file or directory");
		return -1;
	}
	while(1)
	{
		
		str_cpy(str_temp,folder);
		str_cat(str_temp,file_handle.cFileName);
		//printf(_chr(str_temp));
		if(iffile_exist(_chr(str_temp))==1)//if file exist
		{
			file_delete(str_temp);
		}
		
		if ( FindNextFile(FolderHandle, &file_handle )== 0 )
		{
			break;	
		}
		
	}

}
function on_1_event()
{
	remove_all_files_fromfolder("G://2015//Aynalar//aaa//");	
}


You have to use two slash for folder adress. the forum does not allow me to write two slashes side by side. Here is what i'm talking about:


Then you can try to use RemoveDirectory function.

Last edited by Emre; 05/28/18 08:06.