Solved

vbs script to create shortcut

Posted on 2012-03-30
3
453 Views
Last Modified: 2012-04-04
I have a vbs script to create a web shortcut.  

I want to use the web icon instead of a system icon, I cant get shell32.dll, 512 to work anyway.  Its the only icon on the whole list that does not appear when the link is made.  

But anyway, the websites normally have an icon that is used for their page when shortcut is made.  Where on the system can i find this shortcut once it is made?  

So I will need to edit this vbs line...

oShellLink.IconLocation = "%systemroot%\system32\shell32.dll, 20"

Open in new window


** update**
ok I found the web .ico location and added this and it works.  However I noticed it does not work on some desktops, and shows a blank icon instead of the http://web.ico 

Is there a way to create alternative ico if one fails to work?  like
use http://web.ico
) else (
oShellLink.IconLocation = "%systemroot%\system32\shell32.dll, 20"
0
Comment
Question by:icecom4
  • 2
3 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 37788080
The reason it fails is that not all sites have the favicon. Show us the code you are now using.
0
 

Accepted Solution

by:
icecom4 earned 0 total points
ID: 37788547
I was able to get this working, by manually downloading the favicon from the site, adding it to a location on the server, and then the scrips worked.
0
 

Author Closing Comment

by:icecom4
ID: 37805166
I was able to get this working, by manually downloading the favicon from the site, adding it to a location on the server, and then the scrips worked.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question