Use SHFileOperation(). #include <windows.h> #include <tchar.h> #include <assert.h> #include <malloc.h> #include "SHDeleteFile.h" BOOL SHDeleteFile(LPCTSTR lpFile) { size_t len = _tcslen(lpFile); if(!lpFile || lpFile[0]==0 || len <= 3) return FALSE; // only fullpath allowed do { #ifndef UNICODE if (IsDBCSLeadByte((BYTE)lpFile[0])) return FALSE; #endif if( lpFile[0]==_T(’\\’) && lpFile[1]==_T(’\\’) ) break; if( lpFile[1] ==… Continue reading How to move file to a trash