Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

File.windowsShortcut

File.windowsShortcut

In this example, the windowsShortcut method is used to add a shortcut in the Program directory ("Program" is a keyword for the directory in which the program itself is installed, for example, C:\Program Files\Netscape\Netscape 6\" on Windows) to Windows software (misc.exe) that is installed in the "Windows" directory.

var xpiSrc = "misc.exe";
var vi = "1.1.1.1";
initInstall(
  "Windows Shortcut",
  "test",
  vi,
  0);
f = getFolder("Windows");
g = getFolder("Temporary");
addFile(
  "miscshortcut",
  "2.2.2.2",
  xpiSrc,
  f,
  xpiSrc,
  true);
target = getFolder(f, xpiSrc);
shortcutpath = getFolder("Program");
err = File.windowsShortcut(
  target,
  shortcutpath,
  "misc shortcut",
  g,
  "",
  target,
  0);
logComment("file.windowsShortcut returns: " + err);
if (0 == getLastError())
  performInstall();
else
  cancelInstall();

Document Tags and Contributors

 Contributors to this page: Sheppy, trevorh, Fredchat, Rod Whiteley
 Last updated by: Sheppy,