9.7.4 DeleteShortcut (delete a shortcut)
- Purpose
-
Deletes a shortcut.
- Syntax
DeleteShortcut(RootPath, SubPath)
- Arguments
-
- RootPath
-
Specify the location where the shortcut is located.
This value is one of the following.
Value
Meaning
None
In the current executable folder
Lcl_Desktop
Desktop (common group)
Lcl_Startmenu
Start menu (common group)#1
Lcl_Program
Program (common group)#2
Lcl_Startup
Startup (common group)#3
Cur_Desktop
Desktop (user-specific group)
Cur_Startmenu
Start menu (user-specific group)#1
Cur_Program
Program (user-specific group)#2
Cur_Startup
Startup (user-specific group)#3
If you specify Lcl_Desktop, Lcl_Startmenu, Lcl_Program, or Lcl_Startup, execute the script file as a user who has administrator permissions. For details, see 1.8.2 Command behavior.
- SubPath
-
Specify the shortcut name as a character string or as a variable that stores this value.
If you set Lcl_Program or Cur_Program as the shortcut location in RootPath, specify the shortcut name in the following form:
program-group\shortcut-name
- Description
-
The DeleteShortcut command deletes a specified shortcut. The command returns True on successful execution, or False if an error occurs.
If there is no such shortcut, the command returns True without doing anything.
- Example
' Delete shortcut "ABC" from Windows 7 startup. If _OS_ = "WIN_NT6.1" Then DeleteShortcut(Cur_Startup, "ABC") End If
- JP1/Script version
-
Supported from JP1/Script 05-20.