0.9b (c) 1995 Peter Childs
The function retrieves a list of current shares on a server.
Syntax
MyRc = NetEnumerate(NETSHARE, 'shareInfo', SrvName)
Parameters
The parameters specified are:
'shareInfo' The REXX variable receiving the result. The variable is divided into:
o shareInfo.0
The number of netnames shared
o shareInfo.i
The netname entry i, where the variable i has a value from 1 to shareInfo.0
o shareInfo.totalentries
The total number of entries available. If many entries are avaiable the number of entries returned (shareInfo.0) is not identical to the total numbers available
SrvName The server computer name
Note
The server computer name can be specified as '' for a local server.
Example
/* List shared netnames on a server */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETSHARE = 190 SrvName = '\\DOMAIN_CONTRLR' myRc = NetEnumerate(NETSHARE, 'shareInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if shareInfo.1 = 0 then do say 'Server does not share a resource' call DropLsRxutFuncs exit 0 end say 'Number of shared netnames: ' shareInfo.0 say do i=1 to shareInfo.0 say shareInfo.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0
Example Output
Number of shared netnames: 19 IPC$ ADMIN$ A$ B$ C$ D$ E$ F$ G$ NETLOGON IBMLAN$ BIGTREE EDRIVE MO COM1Q VXREXX TOOLKIT LPT1Q USER300
Inf-HTML End Run - Successful