Previous Topic: DeleteItem - Remove an Item from a GroupNext Topic: Initialization File (.ini) Functions


RemoveLink - Remove a Shortcut

Valid on Windows only

The RemoveLink function removes a shortcut.

This function has the format:

RemoveLink(Name as string, Group as string, Offset as integer) as Boolean
Name

Specifies the name of the shortcut to remove.

Group

Identifies the group (or folder) in which the shortcut to be removed is located. If this parameter is an empty string, the value of the Offset parameter determines where the shortcut will be removed.

LNK_PROGRAMS

The item will be removed from the Programs group.

LNK_DESKTOP

The item will be removed from the Desktop.

LNK_STARTMENU

The item will be removed from the Start menu.

LNK_STARTUP

The item will be removed from the Startup group.

LNK_ABSOLUTE

The item will be removed from the specified directory.

On successful completion, the function returns TRUE; otherwise, it returns FALSE.

Example: RemoveLink function

This example deletes a shortcut from desktop.

if Not(RemoveLink("DMS Editor", "", LNK_DESKTOP)) Then
	MessageBox("Failed to deinstall dmsedit from desktop", "Desktop Management Scripting", MB_OK + MB_ICONEXCLAMATION)
	SetStatus(1)
	Exit
End If