Hi!I'm getting gray hairs here, and i'm only 26! 
I'm trying to search *.lnk files for the appearance of a defined program, and if there is a match, delete the *.lnk. I want to do this because I sometimes don't know what the shortcut has been named.
code:
BREAK ON
$Dir = "D:\temp\test"
$Links = "$Dir" + "\*.lnk"
$Program = "vncviewer.exe"$FileName = DIR("$Links")
WHILE $FileName <> "" AND @ERROR = 0
IF OPEN(1, "$Dir" + "\$Filename") = 0
$Content = READLINE(1)
WHILE @ERROR = 0 AND $Found <> 1
IF INSTR("$Content", "$Program") <> 0
$Found = 1 ; $Program appears more than once in the $Links,
?"$Program were found in i: $Filename" ; this is to speed things up.
ENDIF
$Content = READLINE(1)
LOOP
CLOSE(1)
IF $Found = 1
DEL "$Dir" + "\$Filename"
IF @ERROR <> 0
?" Didn't manage to dele the link [$Filename]"
ENDIF
ENDIF
$Found = 0
ENDIF
DIR() ; retrieve next file
LOOP
I only found this thread, unfortunately not containing any solution.
This script works 'sometimes' :/ This is part of a script to update/reinstall VNC.. (will post the full version when i'm done).
[This message has been edited by masken (edited 08 May 2001).]