Hi all,
I'm trying to do the following steps:
1. Ask the user to select a File from a dialog window "Open" (save its original owner and permissions) and also a UserName from the dialog window "Select User or Group" and grant the ownership and full access of the File to the UserName.
2. Wait for the user to finish accessing the File.
3. Automatically return the original owner and permissions (the one that saved in step 1) back to the File.
Using the following commands:
TakeOwn /F "full path of the File"
ICAcLs "full path of the File" /Grant "UserName":F
ICAcLs "full path of the File" /SetOwner "original user"
ICAcLs "full path of the File" /Grant:R "original user":RX
Any help will be appreciated.
TIA