The NetUseDel API ends a connection between a local or UNC device name and a shared resource.
Restrictions
This API can be called from DLS and OS/2 workstations. Administrator authority is required to call this API remotely. However, no access authority is required for local execution.
#include <netcons.h> #include <use.h> NetUseDel(pszServername, netname, forceflag); /* 16 bit */ Net32UseDel(pszServername, netname, forceflag); /* 32 bit */Parameters
See Common Parameter Definitions for descriptions of parameters not defined here.
netname
The following table lists the return codes most significant to this API.
(See API Return Codes for a complete
list of return codes.) ┌─────────────────────────────┬───────┬────────────────────────────────────────┐│SYMBOLICCONSTANT
│VALUE│MEANING │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_Success │ 0 │ No errors were encountered. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_ACCESS_DENIED │ 5 │ Administrator privilege is required. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_INVALID_DRIVE │ 15 │ The specified drive is not valid. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_BAD_NETPATH │ 53 │ The network path cannot be found. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_NETWORK_ACCESS_DENIED │ 65 │ Network access is denied. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_BAD_DEV_TYPE │ 66 │ This network device type is incorrect.
│
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_BAD_NET_NAME │ 67 │ This network name cannot be found. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ ERROR_INVALID_PARAMETER │ 87 │ At least one parameter value is not
│
│ │ │ valid. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_NetNotStarted │ 2102 │ The redirector NETWKSTA.200 has not
│
│ │ │ been started. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_RemoteErr │ 2127 │ A remote API error has occurred. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_WkstaNotStarted │ 2138 │ The Requester service has not been
│
│ │ │ started. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_InternalError │ 2140 │ An internal error has occurred. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_BadTransactConfig │ 2141 │ The server is not configured for
│
│ │ │ transactions. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_InvalidComputer │2351 │Thespecifiedcomputernameisnot
│
│ │ │ valid. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_OpenFiles │ 2401 │ There are open files on the con- │
│ │ │ nection. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_DevInUse │ 2404 │ The device is being accessed by an │
│ │ │ active process. │
└─────────────────────────────┴───────┴────────────────────────────────────────┘
Other codes could be returned from the following functions:
For information about: