How to create a Shortcut through ASP code

zeke11
zeke11 used Ask the Experts™
on
Hello

I want to provide a button on the page, and How do by clicking that button we can create a shortcut for the page on the desktop.

Zeke
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Mark FranzProject Manager

Commented:
You'll need to create an ActiveX COM.

Author

Commented:
But how am i going to do it through ActiveX COM, i am looking for a code.

Author

Commented:
But how am i going to do it through ActiveX COM, i am looking for a code.
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Commented:
or you can do it using the WSH object already provided my MS.  In either case, however, the user's browser must "Trust" your webpage.

Commented:
Direct from Bill:
 set WshShell = WScript.CreateObject("WScript.Shell")
         strDesktop = WshShell.SpecialFolders("Desktop")
         set oShellLink = WshShell.CreateShortcut(strDesktop & "\Shortcut Script.lnk")
         oShellLink.TargetPath = WScript.ScriptFullName
         oShellLink.WindowStyle = 1
         oShellLink.Hotkey = "CTRL+SHIFT+F"
         oShellLink.IconLocation = "notepad.exe, 0"
         oShellLink.Description = "Shortcut Script"
         oShellLink.WorkingDirectory = strDesktop
         oShellLink.Save
         set oUrlLink = WshShell.CreateShortcut(strDesktop & "\Microsoft Web Site.url")
         oUrlLink.TargetPath = "http://www.microsoft.com"
         oUrlLink.Save

Commented:
for the record, mgFranz covered both the WSH method and Q_20367755

cha cha, didn't see that the link was posted.

- Justin

Commented:
No comment has been added lately and it seems that this question have been abandoned. So it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question or invite a Moderator to close this question if there's no reply from you after seven days.

In the absence of responses, I will recommend the following:

To accept the comment and points awarded to  mgfranz


** PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER **


Just trying to help for the cleanup...
gladxml

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial