ShortcutEdit

Modifies the specified shortcut file.

Syntax:

ShortcutEdit(link-name, target, params, start-dir, show-mode [, shortcut-type])

Parameters:

(s) link-name  the name of shortcut .LNK file to be edited.

(s) target  file or directory name which "link-name" will point to.

(s) params  optional command-line parameters for "target"

(s) start-dir  "Start in" directory for "target".

(i) show-mode "Run" mode for "target": @NORMAL, @ZOOMED,or @ICON.

(i) shortcut-type (optional) specifies the type of shortcut. see below

Returns:

(i) @TRUE if the shortcut was successfully modified.; @FALSE if it wasn't.

 

"shortcut-type" specifies the type of shortcut, and can be one of the following:

Type Meaning

0  Normal shortcut (default) 

1  Folder shortcut (Windows 2000/XP only) 

 

You can specify "-1" for "target", "params", or "start-dir" to set NULL values.

See ShortcutMake for further information on these parameters.

Note: In the ShortcutMake and ShortcutEdit functions, if the "target" parameter specifies a UNC, and it does not exist at the time this function is called, then the "target" field in the shortcut may not be properly set. Specifically, it may get truncated after the share name. For example, if you use:

ShortcutMake("test.lnk", "\\server\public\testdir\myprog.exe", "", "", @normal,0)

 

and \\server\public\testdir\myprog.exe doesn't exist, then the target of the share may get set to:

\\server\public 

 

This is due to the behavior of the API function we are calling, and is consistent with the behavior when trying to create or edit a shortcut interactively from Explorer (i.e., you are prevented from specifying an invalid target).

 

Example:


startdir=ShortCutDir("Desktop",0,0)
DirChange(startdir)
dest = StrCat(DirWindows(0),"notepad.exe")
ShortCutMake("mynotepad.lnk", dest, "", "", @NORMAL,0)
ShortCutEdit("mynotepad.lnk", "", "", startdir, @NORMAL,0)
See Also:

ShortcutDir, ShortcutExtra, ShortcutInfo, ShortcutMake