0.9b (c) 1995 Peter Childs
The function creates an alias definition for a resource.
Syntax
MyRc = NetAdd(NETALIAS, 'AliasInfo', SrvName)
Parameters
The parameters required are:
'AliasInfo' The REXX variable holding the alias information values. The variable is divided into:
o AliasInfo.name
The alias name
o AliasInfo.remark
The alias remark
o AliasInfo.server
The name of the server where the resource described by this alias resides. The server name can be different from the SrvName parameter. The leading '\\' should not be specified
o AliasInfo.netname
The alias name for files aliases, and the queue name for printer and serial device aliases. This value is not used by the NetAdd() function
o AliasInfo.location
The alias location. The following values are valid:
Location Location value -------- -------------- Within the domain 'Within Domain' 'INTERNAL' External, for DOS 'External, for DOS' 'EXTERNAL_DOS' External, for OS/2 'External, for OS/2' 'EXTERNAL_OS2' External, for DOS and OS/2 'External, for DOS and OS/2' 'EXTERNAL_BOTH'
The default value is 'Within Domain'
o AliasInfo.mode
When the alias is shared. The following values are valid:
Sharing mode Mode value ------------ ---------- At server startup 'At server startup' 'STARTUP' By administrator 'By administrator' 'BYADMIN' At Requester use 'At Requester use' 'DYNAMIC'
The default value is 'At Requester use'
o AliasInfo.maxuses
The maximum number of users who can have redirection to the resource identified by this alias. The default value is 65535
o AliasInfo.type
The alias type. The following values are valid:
Type Type value ---- ---------- Files alias 'Files' Printer alias 'Printer' Serial alias 'Serial'
o AliasInfo.queue
The queue name for serial or printer alias only
o AliasInfo.path
The path for files alias only
o AliasInfo.priority
The serial device priority. The value can be from 1 to 9. 1 is the highest priority. The value of 9 will be used as default if no value is specified
o AliasInfo.device_pool
The serial device pool. LPT1 to LPT9 and COM1 to COM9 can be used. If specified the entries are separated by a space. For example 'COM1 COM4'
SrvName The server computer name of the domain controller
Note
The server computer name can be specified as '' for a local domain controller.
Example
/* Add a alias */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETALIAS = 20 SrvName = '\\ILIDC' AliasInfo.name = 'THEBOOK' AliasInfo.remark = 'Temporary alias' AliasInfo.server = 'ILIDC' AliasInfo.location = 'Within Domain' AliasInfo.mode = 'At Requester use' AliasInfo.type = 'Files' AliasInfo.path = 'D:\APPS\TEMP' myRc = NetAdd(NETALIAS, 'AliasInfo', SrvName) if myRc <> '0' then do say 'Got error from NetAdd() ' myRc call DropLsRxutFuncs exit 9 end else do say 'Alias added successfully' say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0
Example Output
Alias added successfully
Inf-HTML End Run - Successful