Trying to change an icon for a shortcut via vbs/command line
  Home FAQ Contact Sign in
microsoft.public.windowsxp.customize only
 
Advanced search
POPULAR GROUPS

more...

microsoft ... customize Profile…
 Up
Trying to change an icon for a shortcut via vbs/command line         


Date: Jul 22, 2008 14:08

I have the following vbs script running as a logon script. But everytime it
runs, When the shortcut is created, it is created with the symbol of no icon.
How can I direct the icon location to an actual windows system icon file.
When I open up a file via properties, and browse for a new icon, it directs
me to look in shell32.dll, but I can't find a way to get to all of those
icons shown in that window.

Thanks

set objShell = Wscript.Createobject("Wscript.Shell")
strDesktopFld = objShell.SpecialFolders("Desktop")
Set objURLShortcut = objShell.createShortcut(strDesktopFld &
"\Install-CoM-Applications.lnk")
'Name for Shortcut to add
objURLShortcut.Targetpath = "http://localhost:9595/webportal/webportal.exe"
'Path to icon
objURLShortcut.IconLocation = "C:\WINDOWS\system32\oobe\images\thanks8.png"
'Path for Shortcut
objURLShortcut.Save
4 Comments
RE: Trying to change an icon for a shortcut via vbs/command line         


Author: Andrew E.
Date: Jul 22, 2008 21:37

Open control-panel,folder options,file types,edit.

"booker@mgt" wrote:
> I have the following vbs script running as a logon script. But everytime it
> runs, When the shortcut is created, it is created with the symbol of no icon.
> How can I direct the icon location to...
Show full article (0.98Kb)
no comments
Re: Trying to change an icon for a shortcut via vbs/command line         


Author: ju.c
Date: Jul 22, 2008 23:02

You cannot, I think, use a PNG file as an icon. You must convert "thanks8.png" to an icon
file. That should work.

ju.c

"Andrew E." msn.com> wrote in message
news:FCCE6DE7-4F84-4BC0-A77C-AAB8DB045B43@microsoft.com...
> Open control-panel,folder options,file types,edit.
>
> "booker@mgt" wrote:
>
>> I have the...
Show full article (1.23Kb)
no comments
Re: Trying to change an icon for a shortcut via vbs/command line         


Date: Jul 24, 2008 02:07

Does using an icon file (.ico) help?

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows Shell/User]
The Winhelponline Blog: http://www.winhelponline.com/blog
Windows
no comments
Re: Trying to change an icon for a shortcut via vbs/command line         


Author: a_nonymous
Date: Jul 27, 2008 21:18

"booker@mgt" wrote:
> I have the following vbs script running as a logon script. But everytime it
> runs, When the shortcut is created, it is created with the symbol of no icon.
> How can I direct the icon location to an actual windows system icon file.
> When I open up a file via properties, and browse for a new icon, it directs
> me to look in shell32.dll, but I can't find a way to get to all of those
> icons shown in that window.
> Thanks
>
> set objShell = Wscript.Createobject("Wscript.Shell")
> strDesktopFld = objShell.SpecialFolders("Desktop")
> Set objURLShortcut = objShell.createShortcut(strDesktopFld &
> "\Install-CoM-Applications.lnk")
> 'Name for Shortcut to add
> objURLShortcut.Targetpath = "http://localhost:9595/webportal/webportal.exe"
> 'Path to icon
> objURLShortcut.IconLocation...
Show full article (1.30Kb)
no comments

RELATED THREADS
SubjectArticles qty Group
请问现在出了vb.net 还有必要学vb吗?cn.bbs.comp.lang.visual-basic ·
Re: VB 2005 DDL in VB 6.0 projectmicrosoft.public.vb.general.discussion ·