The method is simple:
Create a new notepad and Copy the following code to save it. The notepad name does not matter. Remember to change the extension to. reg.
After the registry is created, double-click the reg file (Registry File) to import it to the Registry. Before the import, you will be prompted to select the file. Click Yes.
After the import, right-click the folder to which you want to obtain permissions, and right-click the folder to select administrator permissions.
For the sake of security, the default permissions should be restored after a file is operated. Right-click the file and choose Restore original permissions.
1. Obtain administrator permissions
Windows Registry Editor Version 5.00
; Get the file modification permission
[HKEY_CLASSES_ROOT \ * \ shell \ runas]
@ = "Administrator permissions"
"Icon" = "C: \ Windows \ System32 \ imageres. dll, 102"
"NoWorkingDirectory" = ""
[HKEY_CLASSES_ROOT \ * \ shell \ runas \ command]
@ = "Cmd.exe/c takeown/f \" % 1 \ "& icacls \" % 1 \ "/grant administrators: F"
"IsolatedCommand" = "cmd.exe/c takeown/f \" % 1 \ "& icacls \" % 1 \ "/grant administrators: F"
[HKEY_CLASSES_ROOT \ exefile \ shell \ runas2]
@ = "Administrator permissions"
"Icon" = "C: \ Windows \ System32 \ imageres. dll, 102"
"NoWorkingDirectory" = ""
[HKEY_CLASSES_ROOT \ exefile \ shell \ runas2 \ command]
@ = "Cmd.exe/c takeown/f \" % 1 \ "& icacls \" % 1 \ "/grant administrators: F"
"IsolatedCommand" = "cmd.exe/c takeown/f \" % 1 \ "& icacls \" % 1 \ "/grant administrators: F"
[HKEY_CLASSES_ROOT \ Directory \ shell \ runas]
@ = "Administrator permissions"
"Icon" = "C: \ Windows \ System32 \ imageres. dll, 102"
"NoWorkingDirectory" = ""
[HKEY_CLASSES_ROOT \ Directory \ shell \ runas \ command]
@ = "Cmd.exe/c takeown/f \" % 1 \ "/r/d y & icacls \" % 1 \ "/grant administrators: F/t"
"IsolatedCommand" = "cmd.exe/c takeown/f \" % 1 \ "/r/d y & icacls \" % 1 \ "/grant administrators: F/t"
2. Restore original permissions:
Windows Registry Editor Version 5.00
; Restore original Permissions
[HKEY_CLASSES_ROOT \ * \ shell \ runas-]
@ = "Restore original Permissions"
"Icon" = "C: \ Windows \ System32 \ imageres. dll, 101"
"NoWorkingDirectory" = ""
; & Takeown/f \ "% 1 \"
[HKEY_CLASSES_ROOT \ * \ shell \ runas-\ command]
@ = "Cmd.exe/c takeown/f \" % 1 \ "& icacls \" % 1 \ "/reset & cacls \" % 1 \ "/e/r \ "% USERNAME % \""
"IsolatedCommand" = "cmd.exe/c takeown/f \" % 1 \ "& icacls \" % 1 \ "/reset & cacls \" % 1 \ "/e/ r \ "% USERNAME % \""
[HKEY_CLASSES_ROOT \ exefile \ shell \ runas2-]
@ = "Restore original Permissions"
"Icon" = "C: \ Windows \ System32 \ imageres. dll, 101"
"NoWorkingDirectory" = ""
[HKEY_CLASSES_ROOT \ exefile \ shell \ runas2-\ command]
@ = "Cmd.exe/c takeown/f \" % 1 \ "& icacls \" % 1 \ "/reset & cacls \" % 1 \ "/e/r \ "% USERNAME % \""
"IsolatedCommand" = "cmd.exe/c takeown/f \" % 1 \ "& icacls \" % 1 \ "/reset & cacls \" % 1 \ "/e/ r \ "% USERNAME % \""
[HKEY_CLASSES_ROOT \ Directory \ shell \ runas-]
@ = "Restore original Permissions"
"Icon" = "C: \ Windows \ System32 \ imageres. dll, 101"
"NoWorkingDirectory" = ""
[HKEY_CLASSES_ROOT \ Directory \ shell \ runas-\ command]
@ = "Cmd.exe/c takeown/f \" % 1 \ "/r/d y & icacls \" % 1 \ "/reset & cacls \" % 1 \" /e/r \ "% USERNAME % \""
"IsolatedCommand" = "cmd.exe/c takeown/f \" % 1 \ "/r/d y & icacls \" % 1 \ "/reset & cacls \" % 1 \ "/e/r \" % USERNAME % \""