Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบ >> Windows

แก้ไขข้อผิดพลาด "Failed to enumerate objects in the container, Access is denied" ใน Windows

ข้อผิดพลาดนี้เกิดเมื่อพยายามเปลี่ยน Permission ของไฟล์/โฟลเดอร์ แต่สิทธิ์ไม่เพียงพอ หรือ Owner ไม่ถูกต้อง มักเกิดกับไฟล์ที่มาจากคอมพิวเตอร์อื่น หรือระบบป้องกันไฟล์ระบบ

แก้ไขข้อผิดพลาด  Failed to enumerate objects in the container, Access is denied  ใน Windows

3 วิธีแก้ไข

1. เปลี่ยน Owner และ Permission ผ่าน GUI (แนะนำ)

  1. คลิกขวาโฟลเดอร์/ไฟล์ > Properties > แท็บ Security > Advanced
  2. แก้ไขข้อผิดพลาด  Failed to enumerate objects in the container, Access is denied  ใน Windows
  3. คลิก Change (Owner) > Advanced > Find Now > เลือก User ของคุณ > OK > OK > Apply > OK
  4. แก้ไขข้อผิดพลาด  Failed to enumerate objects in the container, Access is denied  ใน Windows
  5. กลับไป Advanced อีกครั้ง > ☑ Replace owner on subcontainers and objects & ☑ Replace all child object permissions entries with inheritable permission entries from this object > Apply > OK
  6. แก้ไขข้อผิดพลาด  Failed to enumerate objects in the container, Access is denied  ใน Windows
  7. กลับไป Security > Advanced > Permissions > Add > Select Principal > ใส่ User ของคุณ > OK

⚠️ การเปลี่ยน Permission อาจทำให้ระบบปลอดภัยน้อยลงเล็กน้อย

2. ใช้ Command Prompt (Admin)

สร้าง Restore Point ก่อน แล้วรันทีละคำสั่ง:

takeown /F X:\FOLDER-PATH
takeown /F X:\FOLDER-PATH /r /d y
icacls X:\FOLDER-PATH /grant Administrators:F
icacls X:\FOLDER-PATH /grant Administrators:F /t

(เปลี่ยน X:\FOLDER-PATH เป็นพาธจริง)

3. ปิด UAC ชั่วคราว (ไม่แนะนำ)

Control Panel > User Accounts > Change UAC settings > เลื่อนไป Never notify > OK > Reboot

หลังเสร็จสิ้น ควรกลับไปตั้ง UAC เป็น Default ทันที เพราะ UAC มีบทบาทสำคัญในการป้องกันระบบ