Hmmmm! 5 posts indeed (I checked). I really have to stop working so hard because I had completely forgotten about those other posts....
Anyway, thanks to both of you for the quick reply. In response to sealeopard's query here is the big picture and a snapshot of the code I am writing.....
code:
BREAK ON
$RC = REDIRECTOUTPUT("",0)
"Gathering password age statistics. Please do not interrupt." ?
dim $servers[28]
$array_num = 0
call "c:\kixtart\server_list.scr"
$output = "C:\PWAGE.TXT"
$age_limit = 91
$readout = "C:\PWAGEFIL_THN.TXT"
$RC = REDIRECTOUTPUT($readout,1) ;\\Overwrite old file
;//Do local server accounts (listed in the array)
while $server[$array_num] <> 0
shell "cmd.exe /c c:\kixtart\netpwage.exe /USERS /COMPUTER:" + $server[$array_num] + " /MIN:" + $age_limit + " /B >" + $output
$RC = REDIRECTOUTPUT($readout,0)
"Local Account Password Age Listing for Server "$server[$array_num] ?
"------------------------------------------------------------------------------------------------" ?
$rc = open(1,$output,2)
$line = readline(1)
do
$line = readline(1)
;$string = len($line)
$accounts = SPLIT($line,,)
for each $account in $accounts
next
;$pwage = substr($line,($string - 3),4)
;$string = len($line)
;$accounts = substr($line,1,20)
;$pwage = substr($line,($string - 3),4)
select
case $accounts = "" $rc = close(1) goto no_accounts_to_list1
case $accounts = "Failed to retrieve u" $rc = close(1) goto errorlog1
endselect
$RC = REDIRECTOUTPUT($readout,0)
" Account Name: " + $accounts[0] + " Password Age:$pwage days Last logged on:14/5/2003 19:50" ?
until $line = ""
:no_accounts_to_list1
$RC = REDIRECTOUTPUT($readout,0)
" No more accounts exceed the " + ($age_limit - 1) + " day password age limit." ?
goto breakloop1
:errorlog1
$RC = REDIRECTOUTPUT($readout,0)
" Failed to retrieve account list from this server." ?
:breakloop1
$RC = REDIRECTOUTPUT($readout,0)
?
$array_num = $array_num + 1
loop
exit
The line I read in is as follows...
Administrator User Account 98
.... and I wish to display the account name and the password age (98) in an output. I am having a bit of difficulty with SPLIT so your help is most grateful.
Kenno
P.S Bear in mind that this is the code that I am playing around with so some syntax errors will be evident.