Masken-

If you try to solve the Drive\Path\Program to a .lnk file only using KixTart, you should try this:

code:

BREAK ON
$Dir = "D:\temp\test"
$Links = "$Dir" + "\*.lnk"
$Program = "vncviewer.exe" ; Include drive and path in searchstring if you can
;$Program = %WINDIR% + "vncviewer.exe" ; Include drive and path for program in searchstring, if you know it

$Found = 0
$FileName = DIR("$Links")
WHILE $FileName <> "" And @ERROR = 0 And $Found = 0
IF OPEN(1, "$Dir" + "\$Filename") = 0
$Content = ""
$Line = READLINE(1)
WHILE $Line And @ERROR = 0
$Content = $Content + $Line
$Line = READLINE(1)
LOOP
$Err = CLOSE(1)
IF InStr($Content, $Program)
DEL $Dir + "\" + $FileName
IF @ERROR <> 0
?" Didn't manage to dele the link [" + $Dir + "\" + $FileName + "]"
ENDIF
$Found = -1
ENDIF
ENDIF
DIR() ; retrieve next file
LOOP



Erik

If for some reason the EOF character should appears in the midle of a .lnk file, you have to use cj's suggestions, it
could be the reason for the failing of your own script!

I have no gray hairs, they fall of before they get gray

[This message has been edited by kholm (edited 08 May 2001).]