How to fix Error Code 5 when trying to capture a reference image.

DE*CORAZON 0 Reputation points
2024-07-07T00:58:44.8+00:00

I am trying to capture a reference I created in a VM. This is the command I am putting in using WinPE. dism /capture-image /imagefile:"D:\WIN11.wim" /capturedir:D:\ /name:WIN11FULL /compress:max. I press enter.

Deployment Image Servicing and Management tool Version 10.0.22321.1

I get Error: 5 Access denied.

Has anyone run into this issue? Please assist. I am stuck right now.

Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,796 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. mikelydick 1 Reputation point
    2024-07-07T01:09:37.15+00:00

    Based on the information provided, it seems you are encountering an "Access denied" error (Error 5) when trying to capture a Windows image using DISM in WinPE. This is a common issue that can occur for a few reasons:

    1. Insufficient permissions: Make sure you are running the command prompt as an administrator.
    2. Drive letter mismatch: In WinPE, drive letters may be assigned differently than in the regular Windows environment. Use the diskpart utility to verify the correct drive letters:
    diskpart
    list volume
    

    This will show you the correct drive letters to use in your DISM command.

    1. Read-only attributes: The target drive or files may have read-only attributes set. Try removing these attributes:
    attrib -r D:\*.* /s /d
    
    1. Antivirus interference: If you have antivirus software running, it may be blocking DISM operations. Try temporarily disabling it.
    2. File system corruption: Run a chkdsk on the drive to ensure there are no file system issues:
    chkdsk D: /f
    
    1. Incorrect WinPE version: Ensure you're using a compatible version of WinPE for the Windows version you're trying to capture.

    To resolve this issue, try the following steps:

    1. Verify the correct drive letters using diskpart.
    2. Run the command prompt as administrator.
    3. Remove read-only attributes from the target drive.
    4. Ensure there are no file system issues by running chkdsk.
    5. Double-check that you're using a compatible WinPE version.

    If the issue persists, you may need to try capturing the image from a different environment or use alternative imaging tools like Microsoft Deployment Toolkit (MDT) or System Center Configuration Manager (SCCM).

    Share

    RewriteBased on the information provided, it seems you are encountering an "Access denied" error (Error 5) when trying to capture a Windows image using DISM in WinPE. This is a common issue that can occur for a few reasons:

    1. Insufficient permissions: Make sure you are running the command prompt as an administrator.
    2. Drive letter mismatch: In WinPE, drive letters may be assigned differently than in the regular Windows environment. Use the diskpart utility to verify the correct drive letters:
    diskpart
    list volume
    

    This will show you the correct drive letters to use in your DISM command.

    1. Read-only attributes: The target drive or files may have read-only attributes set. Try removing these attributes:
    attrib -r D:\*.* /s /d
    
    1. Antivirus interference: If you have antivirus software running, it may be blocking DISM operations. Try temporarily disabling it.
    2. File system corruption: Run a chkdsk on the drive to ensure there are no file system issues:
    chkdsk D: /f
    
    1. Incorrect WinPE version: Ensure you're using a compatible version of WinPE for the Windows version you're trying to capture.

    To resolve this issue, try the following steps:

    1. Verify the correct drive letters using diskpart.
    2. Run the command prompt as administrator.
    3. Remove read-only attributes from the target drive.
    4. Ensure there are no file system issues by running chkdsk.
    5. Double-check that you're using a compatible WinPE version.

    If the issue persists, you may need to try capturing the image from a different environment or use alternative imaging tools like Microsoft Deployment Toolkit (MDT) or System Center Configuration Manager (SCCM).

    https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/dism-image-management-command-line-options-s14?view=windows-11

    https://www.tenforums.com/general-support/173316-winpe-apply-image-access-denied-error-5-a.html

    0 comments No comments