This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Looking For Code For Creating Shortcuts - javascript:setShortcut(); ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Looking For Code For Creating Shortcuts - javascript:setShortcut(); ?" Watch "Looking For Code For Creating Shortcuts - javascript:setShortcut(); ?" New topic
Author

Looking For Code For Creating Shortcuts - javascript:setShortcut(); ?

Chris Chandler
Greenhorn

Joined: Jun 16, 2002
Posts: 1
Does anyone know of any java code for creating shortcuts on a desktop and the start menu just by clicking a link? I think it has to do with javascript:setShortcut();
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
If you mean "JavaScript", look at msdn website under windows scripting host.
Here is an example:
var wsh = new ActiveXObject('WScript.Shell');
strDesktop = WshShell.SpecialFolders("Desktop");
var 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();
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
Forgot to mension - Inetrnet Explorer only
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Looking For Code For Creating Shortcuts - javascript:setShortcut(); ?
 
It's not a secret anymore!