> 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

(btw, this is included in my rag-tag util lib you can get here:
http://www.clabs.org/dl/clutil/)


Chris
http://clabs.org/blogki