Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XP
accessibility
basics
beta.general
beta.help-and-support
configuration_manage
customize
device_driver.dev
embedded
embedded.techpreview
games
general
hardware
help_and_support
messenger
moviemaker
music
network_web
newusers
perform_maintain
photos
print_fax
security_admin
setup_deployment
video
winlogo
wmi
work_remotely
  
 
date: Tue, 22 Jul 2008 14:08:00 -0700,    group: microsoft.public.windowsxp.customize        back       


Trying to change an icon for a shortcut via vbs/command line   
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
date: Tue, 22 Jul 2008 14:08:00 -0700   author:   booker@mgt

RE: Trying to change an icon for a shortcut via vbs/command line   
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 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
>
date: Tue, 22 Jul 2008 21:37:01 -0700   author:   Andrew E.

Re: Trying to change an icon for a shortcut via vbs/command line   
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."  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 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
>>
date: Tue, 22 Jul 2008 23:02:24 -0700   author:   ju.c

Re: Trying to change an icon for a shortcut via vbs/command line   
Does using an icon file (.ico) help?

-- 
Regards,

Ramesh Srinivasan, Microsoft MVP  [Windows Shell/User]
The Winhelponline Blog: http://www.winhelponline.com/blog
Windows® Troubleshooting:  http://www.winhelponline.com


"booker@mgt"  wrote in message 
news:82F65AF1-162E-4BCC-A84A-15A6CC798044@microsoft.com...
>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
>
date: Thu, 24 Jul 2008 14:37:38 +0530   author:   Ramesh, MS-MVP ramesh@unknownhost

Re: Trying to change an icon for a shortcut via vbs/command line   
"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 = "C:\WINDOWS\system32\oobe\images\thanks8.png"
> 'Path for Shortcut
> objURLShortcut.Save

 In 'Path for Icon' line,
"C:\WINDOWS\system32\shell32.dll,0"
will use the first icon in the file 'shell32.dll'. The number after the ','
is the zero-based index of the icon in any file which contains at least one icon.

 In the 'Change Icon' dialog, the index value of the top-left icon is '0'.
0 4 8 ...
1 5 ...
2 6 ...
3 7 ...

(Your 'Path to icon' and 'Path for Shortcut' comments are transposed.)
date: Mon, 28 Jul 2008 14:18:01 +1000   author:   a_nonymous

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us