Adding website's shortcut to desktop through website

Submitted on: 1/6/2015 3:23:00 PM
By: Kapil Bhagia (from psc cd)  
Level: Intermediate
User Rating: By 6 Users
Compatibility: ASP (Active Server Pages), HTML, VbScript (browser/client side)
Views: 1970
     To create a desktop website's shortcut through the website


Adding link to the web browser's favourites is not a big deal. But to create shortcut of your website at the user's desktop is cool. And its pretty easy.

Its simple, you create a VBS file (lets say abcd.vbs) with the following code:

dim WshShell, strDesktop, oUrlLink
set WshShell = CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oUrlLink = WshShell.CreateShortcut (strDesktop + "\Your website's shortcut.URL")
oUrlLink.TargetPath = ""

You change the URL link in the second last line to your website URL and you can rename the shortcut name which will appear on the user's desktop, in the third last line.

Now add the following code in the HTML where you want this functionality:
<a href="abcd.vbs">Add shortcut to Desktop</a>

Try it out, if you find it good enough then vote for this article.

Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Intermediate category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

 There are no comments on this submission.

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)

To post feedback, first please login.