My code below is supposed to change the extension of a group of text files *.txt to *.bak but when I run it I get the message:
Cannot rename file: The filename, directory name, or volume label is incorrect.
What am I doing wrong??
void __fastcall TForm1::Button1Click(TObject *Sender)
{
char *File1="C:\\temp\\test\\*.TXT\0";
char *File2="C:\\temp\\test\\*.BAK\0";
SHFILEOPSTRUCT op;
ZeroMemory(&op, sizeof(op));
op.hwnd = Handle;
op.wFunc = FO_RENAME;
op.pFrom = File1;
op.pTo = File2;
op.fFlags=FOF_MULTIDESTFILES || FOF_FILESONLY;
SHFileOperation( &op);
Label1->Caption="Done";
}
Cannot rename file: The filename, directory name, or volume label is incorrect.
What am I doing wrong??
void __fastcall TForm1::Button1Click(TObject *Sender)
{
char *File1="C:\\temp\\test\\*.TXT\0";
char *File2="C:\\temp\\test\\*.BAK\0";
SHFILEOPSTRUCT op;
ZeroMemory(&op, sizeof(op));
op.hwnd = Handle;
op.wFunc = FO_RENAME;
op.pFrom = File1;
op.pTo = File2;
op.fFlags=FOF_MULTIDESTFILES || FOF_FILESONLY;
SHFileOperation( &op);
Label1->Caption="Done";
}