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

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