*.LNK files are, unfortunately, binary. KiX doesn't really like binary files as it strips CHR(13), CHR(10) and CHR(26) with the READLINE function. I have already suggested some Binary File IO functions, but you have two options in the meantime:

1. WSH/OLE. You can use the FileSystemObject with OLE/COM calls to read bytes or lines and seek to certain positions in a file. More on this in a bit...

2. DEBUG. You can create a text file full of DEBUG commands like D for Dump and then SHELL to DEBUG and < the commands file. You then > the output of debug and use the standard READLINE to read in the text.

The DEBUG output of binary is always in this format:

code:

1091:0000 4C 00 00 00 01 14 02 00-00 00 00 00 C0 00 00 00 L...............
1091:0010 00 00 00 46 0F 00 00 00-20 00 00 00 A0 76 E4 58 ...F.... ....v.X
1091:0020 AD C3 C0 01 00 30 14 DD-58 C3 C0 01 00 F0 8E 64 .....0..X......d
1091:0030 06 54 C0 01 3F C0 15 00-00 00 00 00 01 00 00 00 .T..?...........
1091:0040 00 00 00 00 00 00 00 00-00 00 00 00 8C 00 14 00 ................
1091:0050 1F 0F E0 4F D0 20 EA 3A-69 10 A2 D8 08 00 2B 30 ...O. .:i.....+0


so you can read a line, strip the first 11 and the last 19 chars then you have the hex values separated by space and -


Ok, back to the WSH/OLE/COM idea.


This will read an entire file into a variable:

code:

$sFilename="yourfilenamehere"


; open file for reading
$fText=val("&"+olecallfunc(olecreateobject("Scripting.FileSystemObject"), "OpenTextFile", "s", $sFilename))


; read ALL of file
$sText = olecallfunc($fText, "ReadAll")


; close file
$=olecallfunc($fText, "Close")


$sText now contains the entire file, so you can INSTR or SUBSTR to your hearts content.

cj

------------------
For more scripts goto cj's home page


chrismat@ozemail.com.au