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

Khắc phục lỗi "Unable to execute file in the temporary directory" (Error 5) trên Windows 7, 8, 10

Lỗi Error 5 – Access Denied kèm thông báo "Unable to execute files in the temporary directory" xuất hiện khi chạy file setup. Chỉ có nút OK để đóng, không thể tiếp tục cài đặt. Phổ biến trên Windows 7 nhưng cũng xảy ra trên các phiên bản khác.

Nguyên nhân: Cấu hình quyền (permissions) sai khiến Windows chặn ghi file temp. Đây là lỗi cấu hình hơn là lỗi thực sự. Dưới đây là các cách khắc phục.

Cách 1: Chạy với quyền Administrator (Workaround nhanh)

  1. Tìm file setup (.exe).
  2. Chuột phải > Run as administrator. Nếu có UAC > Yes.

Khắc phục lỗi  Unable to execute file in the temporary directory  (Error 5) trên Windows 7, 8, 10

Cách này bypass quyền ngay lập tức nhưng chưa khắc phục gốc rễ.

Cách 2: Tạo thư mục Temp mới và đổi biến môi trường

  1. Tại ổ hệ thống (thường C:), tạo thư mục mới tên Temp.
    Khắc phục lỗi  Unable to execute file in the temporary directory  (Error 5) trên Windows 7, 8, 10
  2. Chuột phải This PC / My Computer > Properties.
    Khắc phục lỗi  Unable to execute file in the temporary directory  (Error 5) trên Windows 7, 8, 10
  3. Chọn Advanced System Settings (bên trái) > tab Advanced > Environment Variables.
    Khắc phục lỗi  Unable to execute file in the temporary directory  (Error 5) trên Windows 7, 8, 10
  4. Khu vực User variables > double-click TMP.
  5. Giá trị mặc định: %USERPROFILE%\AppData\Local\Temp. Sửa thành C:\Temp > OK tất cả cửa sổ.
    Khắc phục lỗi  Unable to execute file in the temporary directory  (Error 5) trên Windows 7, 8, 10
  6. Thử cài lại chương trình.

Cách 3: Cấp quyền Full Control cho thư mục Temp gốc

  1. Đến thư mục: C:\Users\\AppData\Local (thay TênUser = tên tài khoản của bạn).
  2. Tìm thư mục Temp > chuột phải > Properties > tab Security.
  3. Chọn Everyone > Edit. (Nếu chưa có Everyone, xem GIF thêm user).
  4. Tick Full Control (Allow) > OK > OK.

Khắc phục lỗi  Unable to execute file in the temporary directory  (Error 5) trên Windows 7, 8, 10

Cách này cho phép mọi user ghi vào Temp, giải quyết lỗi quyền Error 5.

Cách 4: Kích hoạt "Include inheritable permissions" trên thư mục Temp

  1. Mở tab Security của thư mục Temp (như cách 3).
  2. Nhấn Advanced. Kiểm tra: SYSTEM, Administrators, User đều có Full Control và Inherited from C:\Users\.
  3. Tick Include inheritable permissions from this object's parent > Continue > Apply > OK.

Quyền hạn Windows phức tạp: thiết lập đúng bảo vệ hệ thống, sai lại chặn tác vụ hợp pháp. Làm theo các cách trên sẽ khắc phục triệt để lỗi Error 5 – Access Denied.