IBM OS/2 LAN Server REXX Utility DLL


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


NetMisc(NETSERVERADMINCMD)


The function executes a program on a remote server.   
Syntax 

MyRc = NetMisc(NETSERVERADMINCMD, RunCommand, SrvName, 'ReturnValue')

  
Parameters 
The parameters required and returned are: 
RunCommand        The command to be executed at the remote server 
SrvName           The server computer name 
'ReturnValue' which is divided into: 
   o ReturnValue.exitCode 
     The program exit code 
   o ReturnValue.available 
     The number of bytes available at the remote location 
   o ReturnValue.returned 
     The number of bytes in the program output. This is limited to 4KB 
     using the NetMisc(NETSERVERADMINCMD) function 
   o ReturnValue.output 
     The program output. This is limited to 4KB in the 
     NetMisc(NETSERVERADMINCMD) function 
  
Example   

/* Perform Net remote admin cmd  */

call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs'
call LoadLsRxutFuncs

NETSERVERADMINCMD = 710

RunCommand = 'DIR C:\'
SrvName    = '\\KING_BALU'

myRc = NetMisc(NETSERVERADMINCMD, RunCommand, SrvName, 'ReturnValue')

if myRc <> '0' then do
 say 'Got error from NetMisc() ' myRc
 rcCode = 9
end
else do
 say 'Remote Exit code was           ' ReturnValue.exitCode
 say 'Returned Bytes are             ' ReturnValue.returned
 say 'Number bytes at remote location' ReturnValue.available
 say 'OutPut was'
 say  ReturnValue.output
 rcCode = 0
end

call DropLsRxutFuncs
call RxFuncDrop 'LoadLsRxutFuncs'

exit rcCode

  
Example Output   

Remote Exit code was            0
Returned Bytes are              1159
Number bytes at remote location 1159
OutPut was

 The volume label in drive C is OS2.
 The Volume Serial Number is A69B:F814
 Directory of C:\

 8-24-94   1:39p     <DIR>           0  .
 8-24-94   1:39p     <DIR>           0  ..
 8-23-94  10:33a       311           0  AUTOEXEC.BAT

 and many more lines



Inf-HTML End Run - Successful