Error Code 31 can apply to any hardware device in Device Manager, but most Code 31 errors occur with optical drives, such as CD and DVD drives.
The Code 31 Device Manager error can occur on any Microsoft operating system, including Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, and more.
Restart your computer if you haven't already. The Code 31 error may be caused by a temporary memory failure.
Did you install a device or make a change in Device Manager just before the Code 31 error appeared? If so, it is possible that the change you made caused the Code 31 error.