What does Windows error code 66 (ERROR_BAD_DEV_TYPE) mean?

 
Could be also:
ConstantTypeOS
EREMOTEerrnoLinux
ENOTEMPTYerrnoMac
EREMOTEerrnoSolaris
ATDISK_DRIVER_INTERNALBugCheck CodeWindows
Previous Next
ERROR_NETWORK_ACCESS_DENIED ERROR_BAD_NET_NAME

ERROR_BAD_DEV_TYPE

WNet APIs distinguish disk and print resources. WNetAddConnection2 documents that a redirected local device must be paired with a compatible resource type, and WNetGetResourceInformation can return ERROR_BAD_DEV_TYPE when the supplied dwType does not match the resource identified by the remote name.

This is a structural input error, not a server availability problem. For example, forcing a print resource through a disk-device mapping path can fail before meaningful remote I/O begins. Letting the provider infer the type can also be preferable when the caller does not actually know it.

Check the NETRESOURCE contract

  • Inspect dwType, lpLocalName, lpRemoteName, and lpProvider together.
  • Use RESOURCETYPE_DISK for redirected drive letters and RESOURCETYPE_PRINT for printer-device redirection where required.
  • If the type is unknown for a deviceless connection, follow the API rules instead of guessing from the string.
  • Do not troubleshoot credentials until the resource/device type pairing is valid.

WNetAddConnection2 · WNetGetResourceInformation


Looking for a different code? Search another status or error code.