Can Tcl manage Windows "shell links" [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/Shell/Shortcut.asp]? Certainly; there are at least six ways: * [Matt Newman]'s tlink32 [http://www.sensus.org/tcl/index.htm] * by way of [DDE], as [David Gravereaux] exemplifies: dde execute progman progman "" "\[CreateGroup(Bogus)\]" dde execute progman progman "" \ "\[AddItem(notepad.exe,BogusPadLink)\]" dde execute progman progman "" "\[ShowGroup(Bogus,0)\]" dde execute progman progman "" "\[ShowGroup(Bogus,1)\]" dde execute progman progman "" "\[DeleteItem(BogusPadLink)\]" dde execute progman progman "" "\[DeleteGroup(Bogus)\]" * [Steve Cassidy] wraps this DDE approach in a progman.tcl [http://www.shlrc.mq.edu.au/~steve/tcl/progman.tcl] package designed "package to allow creation of program groups and shortcuts in the start menu on Windows 9x/NT" * [Bill Schongar]'s WISE hack [http://groups.google.com/groups?q=schongar+shell32.lib+group%3Acomp.lang.tcl*&num=25&hl=en&safe=off&rnum=2&ic=1&selm=37418479%40News.Destek.net] * [freeWrap] includes "shell link" functionality comparable to tlink32's. * [[...]] ---- [RS] tried reading such links, or "shortcuts", in a simpler, and pure-Tcl way. If you look at .lnk files in hexdump, you notice that they contain the string of what they link to, among other things. So I tried just to split on NUL bytes and see whether a snippet is a valid absolute path: proc readlnk {lnk} { set res "" set fp [open $lnk] foreach snip [split [read $fp] \x00] { if {[regexp {[A-Z]:\\} $snip] && [file exists $snip]} { lappend res $snip } } close $fp join $res } This is highly experimental, but it worked on the few examples I tried - please correct me if you know better! Simple links to directories and files work. Links that contain an executable invocation with arguments and icon, are a funny mix of ASCII and Unicode, so splitting on 0 is not a good idea there, and the above code does not work. See also [Symbolic links in Windows/CE] ---- package require tcom set sh [::tcom::ref createobject "WScript.Shell"] set lnk [$sh CreateShortcut {D:\WORK\Acrobat.lnk}] $lnk TargetPath {"D:\Program Files\Adobe\Acrobat 4.0\Acrobat\Acrobat.exe"} $lnk WorkingDirectory {D:\WORK} $lnk Arguments Tutorial.pdf $lnk Save ---- Related information appears in "[Windows specific Tcl commands]". [Microsoft Windows and Tcl] - [Arts and crafts of Tcl-Tk programming]