Otherwise, in a 100% reliable way?
Before you call ShellExecute:
Backup permissions via
Code: Select all
icacls "<path>" /save "<file>" /t /cCode: Select all
icacls "<parent of path>" /restore "<file>"Code: Select all
icacls "<path>" /save "<file>" /t /cCode: Select all
icacls "<parent of path>" /restore "<file>"Code: Select all
PerfLogs
D:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OI;0x1200af;;;LU)S:AI
Code: Select all
icacls C:\ /restore "C:\perms.txt"
Code: Select all
v17.50.0203 - 2017-02-03 15:48
+ Browsing Protected Folders: Experimentally ......
NOTE: Pressing "Continue" *permanently* changes your permissions regarding
this folder. There is no easy way back to the original state.Thanks. But it did not work ("C:\perms.txt" definitely exists):highend wrote:Nope
Save this as "C:\perms.txt"Open a command prompt with admin permissions in C:\Code: Select all
PerfLogs D:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OI;0x1200af;;;LU)S:AI
Execute:Code: Select all
icacls C:\ /restore "C:\perms.txt"
Forever!Filehero wrote:Permanently as per XY session or as a persistent change to the file system / ACL?Code: Select all
v17.50.0203 - 2017-02-03 15:48 + Browsing Protected Folders: Experimentally ...... NOTE: Pressing "Continue" *permanently* changes your permissions regarding this folder. There is no easy way back to the original state.
Yep, confirmed and fixed. It seems there is no way around temporarily opening Explorer together with the prompt -- else you are punished with fishiness. Not a big issue. All this is a very rare situation anyways.highend wrote:Something is fishy here. When you invoke the dialog by trying to enter C:\PerfLogs
within XYplorer and accept it, it works.
BUT!
When you reset the permissions to their former state (through icacls) the File Explorer
asks for permission next time you try to enter the folder (cancelling the dialog after)
but XY will never ask you again?
Even a fresh instance or a XY restart doesn't change that here. You'll immediately see
the "Permission denied" C:\PerfLogs kind of background image when you enter the
folder...
I'm not sure. When I gain access to PerfLogs via WE it's also permanent. No apparent difference to XY.Marco wrote:I think that WE works by injecting some user token into itself, via UAC, to temporarily gain access privileges to protected folders. That would explain the fishiness in accessing such folders by actually changing their permissions instead.
Code: Select all
icacls "C:\PerfLogs"