As you know, Diskpart is a useful utility that helps in managing the disks in a computer. It is a very useful tool that even when the GUI-based disk management tools in Windows 10 operating system fails, the Diskpart utility still tends to work. However, it also does not mean that this utility does not experience issues as it still does, from time to time. One of the issues you may encounter when using the Diskpart utility is when you encounter an error message that says, “DiskPart has encountered an error, Access is denied”.
This kind of error in the Diskpart utility could be caused by a number of factors. For one, it could be that the Write-Protection is enabled on the drive where the operating is being performed or it could also be that the Command Prompt terminal does not have administrator-level permissions to carry out the command. Thus, you can try to run the Diskpart utility again but this time with admin privileges or you could also remote the Write-Protection from the concerned drive. For more details, refer to the instructions given below.
As mentioned, removing the Write-Protection on the concerned drive could also help you fix the problem and there are two ways to get rid of the write protection – you can either use the Diskpart utility or the Registry Editor. How? Refer to the following steps.
ComputerHKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlStorageDevicePolicies

Error Causesdel /f %windir%logscbs*.log
Error Causes“0x80242006, WU_E_UH_INVALIDMETADATA. A handler operation could not be completed because the update contains invalid metadata.”Here are some troubleshooting tips you can try to fix Windows Update Error 0x80242006.
chkdsk /f /r
"STOP 0×00000050: PAGE_FAULT_IN_NONPAGED_AREA – dxgkrnl.sys"A problem has been detected and Windows has been shut down to prevent damage to your computer. The problem seems to be caused by the following file: Dxgkrnl.sys."
"STOP 0x0000000A: IRQL_NOT_LESS_EQUAL – dxgkrnl.sys""Your PC ran into a problem and needs to restart. We’re just collecting some info, and then we’ll restart for you. If you would like to know more, you can search online later for this error: dxgkrnl.sys."
"STOP 0x0000001E: KMODE_EXCEPTION_NOT_HANDLED – dxgkrnl.sys"Some of the common symptoms of this error code include
Error CausesHKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlStorageDevicePolicies
CHKDSK [volume [[path] filename]] [/F] [/V] [/R] [/X] [/C] [: size]]Note: In the command given above, “[/F]” will try to fix the system errors while “[/R]” will be the one to fix the bad sectors.