home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 8 Other
/
08-Other.zip
/
lsmt213c.zip
/
nadmin.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-11-11
|
1KB
|
40 lines
/* Perform Net remote admin cmd */
Parse Arg ServerName RunCommand
If ServerName = '' | RunCommand = ''
Then Do
Say '*'
Say '* Usage: NADMIN {ServerName} {RunCommand}'
Say '*'
Say '* Sample: NADMIN \\BEDDC2 net start'
Say '*'
Exit
End
Else Nop
ServerName = Strip(ServerName,'L','\')
Say '* Server Name:' '\\'ServerName
Drop ReturnValue.
ReturnValue.Available = ''
ReturnValue.ExitCode = ''
ReturnValue.Returned = ''
ReturnValue.Output = ''
RC = NetMisc(710, RunCommand, '\\'ServerName, 'ReturnValue')
If RC = 0
Then Do
Say '. Remote Exit code was :' ReturnValue.ExitCode
Say '. Returned Bytes are :' ReturnValue.Returned
Say '. Number Bytes at Remote Location :' ReturnValue.Available
Say Copies('-',60)
Say ReturnValue.Output
Say Copies('-',60)
End
Else Say '!' RC
Exit