บทช่วยสอนนี้แนะนำวิธีแก้ไขข้อผิดพลาด DISM: "The scratch directory size might be insufficient to perform this operation. This can cause unexpected behavior. Use the /ScratchDir option to point to a folder with sufficient scratch space". ขนาดที่แนะนำคือ 1024 MB. (Error 5)"

ข้อผิดพลาดข้างต้นอาจเกิดขึ้นเมื่อรันคำสั่ง DISM ใดๆ จาก Windows Recovery Environment -> Command Prompt ใน Windows 10, 8 หรือ 7
วิธีแก้ไขข้อผิดพลาด DISM: The scratch directory size might be insufficient to perform this operation
เพื่อแก้ไขข้อผิดพลาด "The scratch directory size might be insufficient to perform this operation" ใน DISM คุณต้องระบุ Scratch Directory ในไดรฟ์ที่มีโฟลเดอร์ "Windows"
- ใช้คำสั่ง DIR (เช่น "dir D:") หรือคำสั่ง BCDEDIT เพื่อหาว่าโฟลเดอร์ Windows อยู่ที่ไดรฟ์ใด
- เช่น หากโฟลเดอร์ "Windows" อยู่ที่ไดรฟ์ "D:" ให้ไปที่ไดรฟ์ Windows โดยพิมพ์ Drive Letter (เช่น D:)
- สร้างโฟลเดอร์ใหม่ชื่อ "Scratch" ด้วยคำสั่ง:
- mkdir D:\Scratch

- เพิ่มตัวเลือก "/ScratchDir:D:\Scratch" ในคำสั่ง DISM: *
ตัวอย่างที่ 1:
– หากต้องการซ่อม Offline Windows Image ด้วยคำสั่ง DISM ให้พิมพ์:
- DISM /Image:D:\ /ScratchDir:D:\Scratch /Cleanup-Image /Restorehealth

ตัวอย่างที่ 2:
– หากต้องการ Rollback ระบบหลัง Windows Update ไม่สำเร็จ ด้วยคำสั่ง DISM ให้พิมพ์:
- DISM /Image:D:\ /ScratchDir:D:\Scratch /Cleanup-Image /RevertPendingActions
ตัวอย่างที่ 3:
– หากต้องการลบ Update Package เฉพาะเจาะจง ด้วยคำสั่ง DISM ให้พิมพ์:
- dism /image:D:\ /ScratchDir:D:\Scratch /Remove-Package /PackageName:Package_for_RollupFix~31bf3856ad364e35~amd64~~16299.192.1.9
* หมายเหตุ: เปลี่ยน Drive Letter D ตามกรณีของคุณ
เสร็จสิ้น! หากคู่มือนี้ช่วยคุณได้ โปรดแสดงความคิดเห็น แชร์และกดไลค์เพื่อช่วยผู้อื่นได้นะครับ