|
Next: Files not sorted properly in Open File(s) Dialog ..
|
| Author |
Message |
External

Since: Jul 22, 2008 Posts: 1
|
(Msg. 1) Posted: Tue Jul 22, 2008 2:08 pm
Post subject: Trying to change an icon for a shortcut via vbs/command line Archived from groups: microsoft>public>windowsxp>customize (more info?)
|
|
|
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 |
|
| Back to top |
|
 |  |
External

Since: Sep 23, 2004 Posts: 156
|
(Msg. 2) Posted: Tue Jul 22, 2008 9:37 pm
Post subject: RE: Trying to change an icon for a shortcut via vbs/command line [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
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
> |
|
| Back to top |
|
 |  |
External

Since: Apr 08, 2008 Posts: 10
|
(Msg. 3) Posted: Tue Jul 22, 2008 11:02 pm
Post subject: Re: Trying to change an icon for a shortcut via vbs/command line [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
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." <eckrichco.TakeThisOut@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 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
>> |
|
| Back to top |
|
 |  |
External

Since: Feb 25, 2008 Posts: 13
|
(Msg. 4) Posted: Thu Jul 24, 2008 2:37 pm
Post subject: Re: Trying to change an icon for a shortcut via vbs/command line [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
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" <dummy.address DeleteThis @mgt.gatech.edu> 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
> |
|
| Back to top |
|
 |  |
External

Since: Jul 28, 2008 Posts: 1
|
(Msg. 5) Posted: Mon Jul 28, 2008 2:18 pm
Post subject: Re: Trying to change an icon for a shortcut via vbs/command line [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
"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.) |
|
| Back to top |
|
 |  |
| Related Topics: | Explorer - command line - What is the command line switch to have explorer open at the root of c: drive? Thanks for the help. Al
Launch file properties from command line - Is there a way to automatically launch the file "Properties" dialog (The window dialog which appears when you right click on a file and select "Properties" in Windows Explorer) from the command line? I am looking around using explorer...
desktop shortcut / icon lower right corner - Instead of right clicking the start-button bar to get "show desktop" I would love a little icon/shortcut in the lower right corner to select. Does one exist? I want this to go right to the desktop. Andy
Shortcut Key or Icon to Enter Data - I have Windows XP Professional. Is it possible to assign a shortcut key, or create a custom icon, that when activated, will enter a text string into wherever my cursor is? I'm tired of re-entering my company's user ID in Lotus Notes, IE, etc., and..
Icon change won't take. - I go to EXPLORE, open the C: and go to TOOLS/FOLDER OPTIONS and click FILE TYPES tab, then highlight either HTM or HTML FILE and then go to the ADVANCED button and try to change the icon and it shows the new icon (gotten from.. |
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum
|
|
|
|