The NetShareDel API deletes a netname from the list of shared resources of a server.
When this function deletes a netname, all connections to the shared resource are disconnected.
Restrictions
This API can be called from DLS and OS/2 workstations. DLS workstations can issue this call locally only if the Peer service is started. A call to this API must be issued to a server or to a workstation with the Peer service installed. Administrator authority is required to call this API.
#include <netcons.h> #include <shares.h> #include <access.h> NetShareDel(pszServername, netname, reserved); /* 16 bit */ Net32ShareDel(pszServername, netname, reserved); /* 32bit */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_BAD_NETPATH │ 53 │ The network path cannot be found. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_NetNotStarted │ 2102 │ The redirector NETWKSTA.200 has not
│
│ │ │ been started. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_ServerNotStarted │ 2114 │ The Server service has not been
│
│ │ │ started. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_InternalError │ 2140 │ An internal error has occurred. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_BadTransactConfig │ 2141 │ The server is not configured for
│
│ │ │ transactions. │
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_NetNameNotFound │ 2310 │ This shared resource does not exist.
│
├─────────────────────────────┼───────┼────────────────────────────────────────┤
│ NERR_InvalidComputer │ 2351 │ The specified computer name is not
│
│ │ │ valid. │
└─────────────────────────────┴───────┴────────────────────────────────────────┘
Other codes could be returned from the following functions:
For information about: