Can Tcl manage Windows "shell links" [L1 ]? Certainly; there are at least six ways:
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)\]"
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!
See also Symbolic links in Windows/CE
Related information appears in "Windows specific Tcl commands". Microsoft Windows and Tcl - Arts and crafts of Tcl-Tk programming