views:

294

answers:

2

I am trying to create something on a webpage that allows my users to create a desktop shortcut. Because my users are NOT technically savvy, I would like to avoid having them try to drag and drop. Is there a way that I could create a button on a webpage (either using JavaScript or .Net) that automatically creates a desktop shortcut for the user?

If you have follow up questions, please let me know. Thanks

A: 

No, not without requiring your users to be sufficiently technically-savvy to give a script or component embedded on the page advanced permissions. (Granted this mostly means saying "Yes," but to a scary-looking prompt. If they've received any advice on the subject, they're going to say "no.")

You can do this with signed Java applets and the like (this question relates to this discussion; basically you want to create a file on their system), but the odds of your users allowing them to run with high privilege are lower (I'd've said) than their being able to handle drag and drop.

I don't think I've ever thought of drag and drop as being a technically-savvy operation. :-)

T.J. Crowder
I don't either, but these users are extremely non-technical :)
cmessier
+3  A: 

Easy way: Using what the browsers offer

In Firefox, dragging & dropping a link to the desktop creates a shortcut in Windows 7. I'm sure all or most major browsers can do this on most platforms. Just point your users to the right direction, maybe by offering them custom step-by-step instructions.

You can style the link as a huge area easy to recognize, drag and drop. No need for it to be just an underlined piece of text.

This is, in my opinion, the only worthwhile way to go.

Hard way: Programming it yourself

I don't think creating a desktop link can be done using JavaScript - there will be too many security restrictions in place blocking it.

For Windows, I think the closest thing would be generating shortcut .lnk files on server side, and offering those for download. It's not trivial though, and its structure is not documented by Microsoft. There are unofficial guides like this: The Windows Shortcut File Format

You may be able to get around generating the files by creating them on your local system, and offering them for download. It may work if you use absolute web addresses - you'd have to try out. Don't forget to test on the various systems: 95, 98, XP, Vista, 7 ....

I'm sure there are equivalent shortcut formats on Mac OS and the various Linux Desktops, but I don't know them.

Pekka