View Single Post
Old 04-14-2008   #2 (permalink)
Gerd Schneider
Guest


 

RE: Shortcuts w/ Favicon?

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


"Barry S." wrote:
Quote:

> 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'.
>