delete,copy,rename files and directories in WINAPI ..?
- by Kristian
hi I made a code that search in a givin path for a certain file name or folder and print the value BUT now how can i modify it to instead of printing its name perform on of the operations ( delete,copy,rename ) I searched on google and found nothin.
#include "stdafx.h"
#include <windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
TCHAR *fn;
fn=L"d:\\*";
HANDLE f;
WIN32_FIND_DATA data;
f=FindFirstFile(fn,&data);
if(f==INVALID_HANDLE_VALUE){
printf("not found\n");
return 0;
}
else{
_tprintf(L"found this file: %s\n",data.cFileName);
}
while(FindNextFile(f,&data)){
{
_tprintf(L"found this file: %s\n",data.cFileName);
}
}
}
FindClose(f);
return 0;
}