裝了雙系統(tǒng)后,后來某些原因要刪除一個系統(tǒng),在用系統(tǒng)在c盤,要刪除的系統(tǒng)在D盤,可是當(dāng)刪除D盤中的系統(tǒng)文件時,“you require permission from trustedinstaller to make change”,在網(wǎng)絡(luò)上搜尋良久,發(fā)現(xiàn)一個方法可以獲取文件夾權(quán)限,具體代碼如下(注冊表):
Windows Registry Editor Version 5.00
?
[HKEY_CLASSES_ROOT\*\shell\runas]
@=
"Take Ownership"
"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\Directory\shell\runas]
@=
"Take Ownership"
"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"
?
--卸載注冊表文件
Windows Registry Editor Version 5.00
?
[-HKEY_CLASSES_ROOT\*\shell\runas]
[-HKEY_CLASSES_ROOT\Directory\shell\runas]
????? 為方便使用,將代碼做成reg文件,可以添加到右鍵菜單中,下面提供做好的zip文件夾,當(dāng)然你也可以新建記事本,將以上代碼拷貝到文件中,雙擊既可以添加到注冊表中。
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯(lián)系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
