I have written a C++ program which fixes the attributes using ShellExecute Function and displays the result inn the list box
int USB::FixAttributes(wchar_t buffer[10])
{
PWSTR show = L"/c attrib -s -r -h *.* /s /d /l ";
ShellExecute(NULL, L"open", L"cmd.exe", show, buffer, SW_HIDE);
wchar_t* no1 = L"Attributes has been fixed successfully";
SendMessage(list1, LB_ADDSTRING, NULL, (LPARAM)no1);//add message to list box
return 0;
}
buffer is nothing but an drive string e.g H:\
But the message("Attributes has been fixed successfully") has been added to the list box before the completion of the ShellExecute function thereby it gives false information how to solve it!
Thank you