| Author |
shortcuts / icons / program groups on windows?
|
|
| lister 2005-07-24, 10:09 pm |
| Is there a TCL package for messing with shortcuts / icons / program
groups on windows?
| |
| Pat Thoyts 2005-07-24, 10:09 pm |
| lister <lister@primetime.com> writes:
>Is there a TCL package for messing with shortcuts / icons / program
>groups on windows?
You can manipulate shortcuts using the WScript.Shell object by using
the tcom package. Here's a demo that creates a shortcut on the
desktop. It's a translation of a MS demo from the MSDN scripting
pages.
package require tcom
set oShell [tcom::ref createobject "WScript.Shell"]
set sDesktop [[$oShell SpecialFolders] Item "Desktop"]
set oShortcut [$oShell CreateShortcut \
[file nativename \
[file join $sDesktop "Tcl Shortcut Demo.lnk"]]]
$oShortcut TargetPath [file nativename [file normalize [info script]]]
$oShortcut WindowStyle 1
$oShortcut Description "Demonstrate shortcut handling with Tcl"
$oShortcut Save
--
Pat Thoyts http://www.patthoyts.tk/
To reply, rot13 the return address or read the X-Address header.
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
| |
|
|
| lister 2005-07-25, 5:35 pm |
| Pat Thoyts wrote:
Thanks Pat!
Not being a windows guy, how would I associate an icon for the
shortcut? Or if you prefer, where would I read about the details
of what this is doing so I can learn that (MSDN scripting pages?)?
>
> You can manipulate shortcuts using the WScript.Shell object by using
> the tcom package. Here's a demo that creates a shortcut on the
> desktop. It's a translation of a MS demo from the MSDN scripting
> pages.
>
> package require tcom
> set oShell [tcom::ref createobject "WScript.Shell"]
> set sDesktop [[$oShell SpecialFolders] Item "Desktop"]
> set oShortcut [$oShell CreateShortcut \
> [file nativename \
> [file join $sDesktop "Tcl Shortcut Demo.lnk"]]]
> $oShortcut TargetPath [file nativename [file normalize [info script]]]
> $oShortcut WindowStyle 1
> $oShortcut Description "Demonstrate shortcut handling with Tcl"
> $oShortcut Save
>
>
|
|
|
|