Originally do not want to write these things, but often encountered, or record it!
One click to get the administrator's highest privileges
Create a TXT file, and then change the suffix to. reg format: Content as follows
- Windows Registry Editor Version 5.00
- [Hkey_classes_root*shellrunas]
- @= "Get the highest administrative privileges"
- "Noworkingdirectory" = ""
- [Hkey_classes_root*shellrunascommand]
- @= "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_ROOTEXEFILESHELLRUNAS2]
- @= "Get the highest administrative privileges"
- "Noworkingdirectory" = ""
- [Hkey_classes_rootexefileshellrunas2command]
- @= "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_rootdirectoryshellrunas]
- @= "Get the highest administrative privileges"
- "Noworkingdirectory" = ""
- [Hkey_classes_rootdirectoryshellrunascommand]
- @= "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"
Please restart ... ok