I'm trying to use this code to grant the current user full permissions to access System Volume Information:
//It works when manually written in cmd
cacls "E:\System Volume Information" /t /e /g %username%:F
//but using this formula to make the command window hidden does not work(doesn't give the permission or hide the window)
Process^ P = gcnew Process;
P->StartInfo->FileName = "cacls.exe";
P->StartInfo->Arguments = "cacls \"E:\\System Volume Information\" /t /e /g %username%:F";
P->StartInfo->WindowStyle = ProcessWindowStyle::Hidden ;
P->Start();
The code compiles but doesn't work.
Could anyone please give the right code please?