續先前的記錄 Windows 檔案權限問題
其實網路上有個更快的方法,透過修改機碼的方式增加右鍵選單來取得檔案權限TakeOwnership
其實裡面的內容看起來就是把 cmd 的內容以右鍵取代了
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT*shellrunas]
@="Take Ownership"
"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_ROOTDirectoryshellrunas]
@="Take Ownership"
"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"
如果想刪除的話
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT*shellrunas]
[-HKEY_CLASSES_ROOTDirectoryshellrunas]