Qt Change file permissions
static void Changefilepermission (const QString &filepath)
{
#ifdef WIN32
QString cmd ("Icacls.exe \" ");
cmd + = FilePath;
cmd + = "\"/grant Everyone: (F) ";
Startupinfow si;
Process_information Pi;
ZeroMemory (&si, sizeof (SI));
SI.CB = sizeof (SI);
#ifndef _DEBUG
Si.dwflags = Startf_useshowwindow;
Si.wshowwindow = Sw_hide;
#endif
ZeroMemory (&pi, sizeof (PI));
CREATEPROCESSW (NULL,//No module name (with command line).
(wchar_t*) Cmd.utf16 (),//Command line.
NULL,//Process handle not inheritable.
NULL,//Thread handle not inheritable.
False,//Set handle inheritance to false.
0,//No creation flags.
NULL,//Use the parent ' s environment block.
NULL,//Use parent ' s starting directory.
&si,//Pointer to STARTUPINFO structure.
&PI); Pointer to Process_information structure.
WaitForSingleObject (pi.hprocess, INFINITE);
CloseHandle (pi.hprocess);
CloseHandle (Pi.hthread);
#endif
}
qt Change file permissions