jQuery in Action, 2nd edition*
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


Win a copy of Spring in Action this week in the Spring forum!
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: Looking For Code For Creating Shortcuts - javascript:setShortcut(); ?