0.9b (c) 1995 Peter Childs
The function lists all current connections between the local computer and resources on a remote server.
Syntax
MyRc = NetEnumerate(NETUSE, 'useInfo', SrvName)
Parameters
The parameters specified are:
'useInfo' The REXX variable receiving the result. The variable is divided into:
o useInfo.count
The number of net uses. The same information is stored in the variable useInfo.0
o useInfo.i.local
The local device entry i, where the variable i has a value from 1 to useInfo.count
o useInfo.i.remote
The UNC name entry i, where the variable i has a value from 1 to useInfo.count
o useInfo.i.status
Tthe status of the connection entry i where the variable i has a value from 1 to useInfo.count
o useInfo.i.asg_type
The type of remote resource being accessed entry i, where the variable i has a value from 1 to useInfo.count
o useInfo.i.refcount
The number of files, directories, and other processes that are open on the remote resource for entry i
o useInfo.i.usecount
The number of explicit connections (redirection of a local device name) or implicit UNC connections (redirection of a null local device name) that are established with the resource for entry i
SrvName The server computer name
Note
The server computer name can be specified as '' for a local server.
Example
/* List net uses */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETUSE = 270 SrvName = '' /* On this local computer */ /* SrvName = '\\DOMAIN_CONTRLR' */ myRc = NetEnumerate(NETUSE, 'useInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if useInfo.count = 0 then do say 'No net uses are active' call DropLsRxutFuncs exit 0 end say 'Number of net uses: ' useInfo.count do i=1 to useInfo.count say say useInfo.i.local say useInfo.i.remote end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0
Example Output
Number of net uses: 3 Y: \\DOMAIN_CONTRLR\C$ LPT2 \\DOMAIN_CONTRLR\LPT1Q UNC connection \\DOMAIN_CONTRLR\IPC$
Inf-HTML End Run - Successful