Chris Morris wrote:
>>Is there an easy way to create or modify shell links (.lnk) with ruby on
>>windows? I know how to do that in C/C++ or Delphi, and I know that there
>>is a scripting object named ShellLinkObject.Application that could be
>>used by scripting languages (=>ruby, via the winole module), but
>>unfortunately it is only available on Win2000 or XP because these have a
>>newer version of the windows shell (5.00 as opposed to 4.71).
> 
> 
> The following depends on the Windows Scripting Host to be installed, but
> this should exist on most systems by now:
> 
>   def create_shortcut(targetFileName, linkName)
>     shell = WIN32OLE.new("WScript.Shell")
>     scut = shell.CreateShortcut(linkName + '.lnk')
>     scut.TargetPath = File.expand_path(targetFileName)
>     scut.Save
>     scut
>   end

I do not intend to surrender to the evil Windows Scripting Host, thus 
this solution is not applicable for me. My home PC with Win98SE does not 
have WSH installed, never had, and never will.

The tool in question where I need to create Win23 shell links is a small 
Delphi-written tool which scans a directory tree for subdirectories with 
a certain naming scheme, creates a new directory, the name of which is 
derived from the results of the search, and finally (re)creates a shell 
link named "Latest" pointing to that newly created directory. It is a 
tool purely for private use, and one day I thought it would be nice if 
that program was a ruby script instead of a Delphi-compiled .exe, so I 
ran into the problem of how to create links.

-- 
(defun f(p x)(If(Eq x nil)nil(If(p(Car x))(Cons(Car x)(f p(Cdr x)))(f p
(Cdr x)))))(defun q(x)(Q nil x))(defun Q(a x)(If(Eq x nil)a(Q(Cons(Car
x)(Q a(f(Lt(Car x))(Cdr x))))(f(Gt(Car x))(Cdr x)))))