First of all sorry for being so silent all day yesterday. As i was a bit frustrated the day before
( from not getting the script working ) i woke up at 3am yesterday and scrapped the script completely.
This time i reworked it and used a couple of UDF's to simplify my work. I know, it's like cheating
but , IT works. I've copied everything to my laptop just now. You can bet on it that i'll be studying those UDF's " getlinecount() / isinarray() and pipe()" .
Using them allowed me to reduce and simplify the code a lot.
A big thank you to the authors of these UDF's ( sealeopard, i think you know who i'm talking
about ).

code:
 
; Issuing a couple of good old DOS commands

SHELL 'CMD /C del u:\FS-Compare\rmtshare.txt'
SHELL 'CMD /C RMTSHARE \\server >> u:\FS-Compare\rmtshare.txt'

; here the script starts for real

open(1,"u:\FS-Compare\stripped-result.txt",5)
open(2,"u:\FS-Compare\rmtshare.txt")
open(3,"u:\FS-Compare\bruhub-nok.txt",5)
open(4,"u:\FS-Compare\bruhub-ok.txt",5)

while @ERROR = 0
IF INSTR($line,"y:\path\")
$MyArray = split($line,"$")
WriteLine( 1 , $myarray[0] + @CRLF)
ENDIF

$line = readline(2)
loop

; counting the lines in detectdirs.txt & stripped-result.txt

close(1)
open(1,"u:\FS-Compare\stripped-result.txt")

$searchstring = readline(1)

$maxstripcount = getlinecount('u:\fs-compare\stripped-result.txt')

;Retrieving the directories
use y: /del
use y: "\\server\path$"

$dirarray = PIPE('DIR y:\*.* /AD/B')


; Here starts the compare section

FOR $stripcount = 1 to $maxstripcount STEP 1
IF NOT ISINARRAY($dirarray, $searchstring)
WRITELINE(3, $searchstring + @CRLF )
ELSE
WRITELINE(4, $searchstring + @CRLF )
ENDIF
$searchstring = readline(1)
NEXT

close(1)
close(2)
close(3)
close(4)


Note that i left out the code bit of each function since you can refer to that in the different UDF
libraries. Anyone, feel free to use this and rework it for your purpose. And i did not supress the zero's for a good reason. I kept them as a progress indicator. This may be a stupid idea but it's better then thinking your script has locked up when it takes a bit longer.