• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Chris Chandler
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forgot to mension - Inetrnet Explorer only
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic