Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Shortcuts w/ Favicon?

26 views
Skip to first unread message

Barry S.

unread,
Apr 13, 2008, 1:44:40 AM4/13/08
to
The shortcut works fine, but I can't seem to get it to use the
favorite icon.

$wsh = new-object -com "WScript.Shell"
$FileName = "C:\Documents and Settings\xxx\Desktop\CNN.lnk"
$shortcut = $wsh.CreateShortcut($FileName)
$shortcut.IconLocation = "http://www.cnn.com/favicon.ico"
$shortcut.TargetPath = "http://www.cnn.com"
$shortcut.Save()

What am I missing?

__________________
Note: To reply, replace the word 'spam' embedded in return address with 'mail'.

Gerd Schneider

unread,
Apr 14, 2008, 2:46:01 AM4/14/08
to
As far as I remember .LNK files generally do not support IconLocation beeing
specified as an URL. Internet Shortcut files (.URL) do.

$isc= @'
[InternetShortcut]
URL=http://www.cnn.com/
IconFile=http://www.cnn.com/favicon.ico
IconIndex=1
'@
sc "$($env:userprofile)\Desktop\CNN.url" $isc


--
Gerd

Gerd Schneider

unread,
Apr 14, 2008, 2:53:00 AM4/14/08
to
The IconIndex=1 is nonsense of course, it's a leftover from my sample file.

--
Gerd

0 new messages