Computer >> Hướng Dẫn Máy Tính >  >> Xử Lý Sự Cố >> Lỗi Windows

Cách xóa an toàn file bị bảo vệ bởi TrustedInstaller trong Windows 10

Cách xóa an toàn file bị bảo vệ bởi TrustedInstaller trong Windows 10

Cách xóa file bị bảo vệ bởi TrustedInstaller trong Windows 10: TrustedInstaller là tiến trình của Windows Modules Installer, sở hữu quyền kiểm soát nhiều file hệ thống, thư mục và chương trình. TrustedInstaller là tài khoản người dùng được dịch vụ Windows Modules Installer dùng để nắm quyền sở hữu các file và thư mục hệ thống được bảo vệ. Ngay cả khi bạn là quản trị viên (administrator), các file này không thuộc về bạn và bạn không thể sửa đổi chúng theo bất kỳ cách nào.

Cách xóa an toàn file bị bảo vệ bởi TrustedInstaller trong Windows 10

Nếu bạn thử đổi tên, xóa, chỉnh sửa file/thư mục thuộc sở hữu của TrustedInstaller, bạn sẽ nhận được thông báo lỗi: "You do not have permission to perform this action" (Bạn không có quyền thực hiện hành động này) và "You need permission from TrustedInstaller to make changes to this file or folder" (Bạn cần quyền từ TrustedInstaller để thay đổi file/thư mục này).

Đừng lo lắng, để xóa file bị bảo vệ bởi TrustedInstaller trong Windows 10, bạn phải trước tiên lấy quyền sở hữu (take ownership) của file hoặc thư mục bạn muốn xóa. Sau khi có quyền sở hữu, bạn có thể cấp quyền kiểm soát đầy đủ (full control) cho tài khoản người dùng của mình.

Có thể xóa tài khoản TrustedInstaller khỏi quyền sở hữu file không?

Ngắn gọn: Có, bạn có thể nhưng không nên làm vậy vì TrustedInstaller được tạo ra để bảo vệ file và thư mục hệ thống. Ví dụ, nếu virus/malware tấn công máy tính, chúng sẽ không thể sửa đổi file/thư mục hệ thống vì chúng được bảo vệ bởi TrustedInstaller. Nếu bạn vẫn cố gắng xóa tài khoản TrustedInstaller khỏi quyền sở hữu, bạn sẽ nhận được lỗi:

You can't remove TrustedInstaller because this object is inheriting permissions from its parent. To remove the TrustedInstaller, you must prevent this object from inheriting permissions. Turn off the option for inheriting permissions, and then try again.

Quá trình lấy quyền sở hữu file hơi dài nhưng đừng lo, đó là lý do chúng tôi có mặt. Bài viết này sẽ hướng dẫn bạn từng bước Cách xóa file bị bảo vệ bởi TrustedInstaller trong Windows 10 bằng cách lấy lại quyền sở hữu từ TrustedInstaller.

3 cách xóa file bị bảo vệ bởi TrustedInstaller trong Windows 10

Hãy tạo điểm khôi phục hệ thống phòng khi có sự cố.

Phương pháp 1: Lấy quyền sở hữu file/thư mục thủ công trong Windows 10

1. Mở file hoặc thư mục bạn muốn lấy lại quyền sở hữu từ TrustedInstaller.

2. Chuột phải vào file/thư mục đó chọn Properties (Thuộc tính).

Cách xóa an toàn file bị bảo vệ bởi TrustedInstaller trong Windows 10

3. Chuyển sang tab Security (Bảo mật) rồi nhấn nút Advanced (Nâng cao).

Cách xóa an toàn file bị bảo vệ bởi TrustedInstaller trong Windows 10

4. Cửa sổ Advanced Security Settings mở ra, bạn thấy TrustedInstaller có Full Control (Kiểm soát đầy đủ) trên file/thư mục này.

Cách xóa an toàn file bị bảo vệ bởi TrustedInstaller trong Windows 10

5. Bên cạnh tên Owner (là TrustedInstaller) nhấn Change (Thay đổi).

6. Cửa sổ Select User or Group (Chọn người dùng hoặc nhóm) hiện ra, nhấn tiếp nút Advanced ở dưới cùng.

Cách xóa an toàn file bị bảo vệ bởi TrustedInstaller trong Windows 10

7. Cửa sổ mới mở, nhấn nút "Find Now" (Tìm ngay).

8. Danh sách tài khoản người dùng hiện ra ở phần "Search results:", chọn tài khoản của bạn để làm chủ sở hữu mới cho file/thư mục và nhấn OK.

Cách xóa an toàn file bị bảo vệ bởi TrustedInstaller trong Windows 10

9. Nhấn OK tiếp trên cửa sổ Select User or Group.

Cách xóa an toàn file bị bảo vệ bởi TrustedInstaller trong Windows 10

10. Quay lại cửa sổ Advanced Security Settings, tick vào "Replace owner on subcontainers and objects" (Thay thế chủ sở hữu trên các container và đối tượng con) nếu bạn cần xóa nhiều file trong một thư mục.

Cách xóa an toàn file bị bảo vệ bởi TrustedInstaller trong Windows 10

11. Nhấn Apply rồi OK.

12. Từ cửa sổ Properties của file/thư mục, lại nhấn nút Advanced dưới tab Security.

Cách xóa an toàn file bị bảo vệ bởi TrustedInstaller trong Windows 10

13. Nhấn nút Add để mở cửa sổ Permission Entry, sau đó nhấn liên kết "Select a principal" (Chọn chủ thể).

Cách xóa an toàn file bị bảo vệ bởi TrustedInstaller trong Windows 10

Cách xóa an toàn file bị bảo vệ bởi TrustedInstaller trong Windows 10

14. Lại nhấn Advanced rồi Find Now.

15. Chọn tài khoản người dùng bạn chọn ở bước 8 và nhấn OK.

Cách xóa an toàn file bị bảo vệ bởi TrustedInstaller trong Windows 10

16. Quay lại cửa sổ Permission Entry, tick chọn tất cả các ô dưới "Basic permissions" (Quyền cơ bản).

Cách xóa an toàn file bị bảo vệ bởi TrustedInstaller trong Windows 10

17. Cũng tick "Only apply these permissions to objects and/or containers within this container" (Chỉ áp dụng quyền này cho đối tượng/container bên trong container này) và nhấn OK.

18. Cảnh báo bảo mật hiện ra, nhấn Yes để tiếp tục.

19. Nhấn Apply, OK, và lại OK trên cửa sổ Properties file/thư mục.

20. Bạn đã thay đổi thành công quyền sở hữu file/thư mục, bây giờ có thể sửa đổi, đổi tên, xóa file/thư mục đó dễ dàng.

Bây giờ bạn có thể xóa file bị bảo vệ bởi TrustedInstaller trong Windows 10 bằng phương pháp trên, nhưng nếu bạn không thích quy trình thủ công dài dòng này, bạn có thể dùng phương pháp dưới đây để thêm tùy chọn "Take Ownership" vào menu chuột phải và dễ dàng lấy quyền sở hữu bất kỳ file/thư mục nào.

Phương pháp 2: Lấy quyền sở hữu file/thư mục trong Windows 10 bằng Registry

1. Mở Notepad, copy và dán mã sau vào:

Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\*\shell\runas]
[HKEY_CLASSES_ROOT\*\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"
[HKEY_CLASSES_ROOT\*\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F /c /l & pause"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F /c /l & pause"
[-HKEY_CLASSES_ROOT\Directory\shell\runas]
[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t /c /l /q & pause"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t /c /l /q & pause"
[-HKEY_CLASSES_ROOT\dllfile\shell\runas]
[HKEY_CLASSES_ROOT\dllfile\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"
[HKEY_CLASSES_ROOT\dllfile\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F /c /l & pause"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F /c /l & pause"
[-HKEY_CLASSES_ROOT\Drive\shell\runas]
[HKEY_CLASSES_ROOT\Drive\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"
[HKEY_CLASSES_ROOT\Drive\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t /c /l /q & pause"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t /c /l /q & pause"
[-HKEY_CLASSES_ROOT\exefile\shell\runas]
[HKEY_CLASSES_ROOT\exefile\shell\runas]
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\exefile\shell\runas\command]
@="\"%1\" %*"
"IsolatedCommand"="\"%1\" %*"

2. Menu Notepad chọn File > Save As.

Cách xóa an toàn file bị bảo vệ bởi TrustedInstaller trong Windows 10

3. Save as type chọn "All Files (*.*)", đặt tên file bất kỳ nhưng phải thêm .reg ở cuối (ví dụ: takeownership.reg) vì phần mở rộng này rất quan trọng.

Cách xóa an toàn file bị bảo vệ bởi TrustedInstaller trong Windows 10

4. Chọn nơi lưu (khuyên dùng Desktop) và nhấn Save.

5. Chuột phải vào file .reg vừa tạo, chọn Install từ menu ngữ cảnh.

Lưu ý: Cần tài khoản administrator để cài script vào registry.

6. Nhấn Yes để thêm mã vào Windows Registry.

7. Sau khi cài thành công, bạn có thể dễ dàng lấy quyền sở hữu bất kỳ file/thư mục nào bằng cách chuột phải chọn "Take Ownership" từ menu ngữ cảnh.

Cách xóa an toàn file bị bảo vệ bởi TrustedInstaller trong Windows 10

8. Bạn có thể gỡ script bất cứ lúc nào bằng cách làm lại bước 1-4 nhưng dùng mã sau:

Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\*\shell\runas]
[-HKEY_CLASSES_ROOT\Directory\shell\runas]
[-HKEY_CLASSES_ROOT\dllfile\shell\runas]
[-HKEY_CLASSES_ROOT\Drive\shell\runas]
[-HKEY_CLASSES_ROOT\exefile\shell\runas]
[HKEY_CLASSES_ROOT\exefile\shell\runas]
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\exefile\shell\runas\command]
@="\"%1\" %*"
"IsolatedCommand"="\"%1\" %*"

9. Lưu file với tên Uninstallownership.reg.

10. Nếu muốn xóa tùy chọn "Take Ownership" khỏi menu chuột phải, nhấp đúp vào Uninstallownership.reg và nhấn Yes.

Phương pháp 3: Dùng ứng dụng thứ 3 để thay đổi quyền sở hữu file/thư mục

Với ứng dụng Take Ownership, bạn dễ dàng lấy quyền sở hữu bất kỳ file/thư mục nào và xóa file bị bảo vệ bởi TrustedInstaller. Ứng dụng hoạt động giống phương pháp 2 nhưng bạn chỉ cần cài phần mềm (có hoặc không cần quyền admin) thay vì tự tạo script.

Chỉ cần cài ứng dụng Take Ownership, nó sẽ thêm tùy chọn "Take Ownership" vào menu chuột phải của Windows 10.

Các bài viết liên quan:

  • Sửa lỗi "Application has been blocked from accessing Graphics hardware"
  • Sửa lỗi "You Need Permission To Perform This Action"
  • Cách tạo tài khoản Windows 10 dùng Gmail
  • Sửa lỗi Microsoft Edge không hoạt động trên Windows 10

Hy vọng các bước trên giúp bạn xóa file bị bảo vệ bởi TrustedInstaller trong Windows 10. Nếu còn thắc mắc về hướng dẫn này hoặc dịch vụ TrustedInstaller, hãy bình luận bên dưới.