vbs script to create shortcut

Posted on 2012-03-30
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"
Question by:icecom4
  • 2
LVL 83

Expert Comment

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

Accepted Solution

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.

Author Closing Comment

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.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now