Hitachi

JP1 Version 11 JP1/Script Description and Reference (For Windows Systems)


9.7.3 MakeShortcut (create a shortcut)

Purpose

Creates a shortcut.

Syntax
MakeShortcut(RootPath, SubPath, LinkPath, [Param], [WorkDirPath], [IconPath], [IconIndex] [, IconFlag])
Arguments
RootPath

Specify the location where the shortcut is to be created.

This value is one of the following.

Value

Meaning

None

Create 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

#1 Windows Start menu

#2 Windows Start, and then Programs

#3 Windows Start, Programs, and then Startup

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

LinkPath

Specify the path to the executable file that the shortcut points to. Write a character string or a variable that stores this value.

Param

Specify the necessary parameters for executing the file specified in LinkPath. Write each parameter as a string, or specify a variable that stores this value.

WorkDirPath

Specify the work folder name as a character string or as a variable that stores this value.

This value is optional. If you omit this value, the folder of the path specified in LinkPath is assumed.

IconPath

Specify the name of the icon file containing the icons used for shortcuts. Write the path as a character string or as a variable that stores this value.

This value is optional. If you omit this value, the path specified in LinkPath is assumed.

IconIndex

Specify the index number of the icon inside the icon file specified in IconPath. Specify 0 or a number, or a variable that stores this value.

This value is optional. If you omit this value, 0 is assumed.

IconFlag

Specify how to display the window when the shortcut is activated. Set one of the following values:

Value

Meaning

Normal

Normal window

Min

Minimized into a button in the task bar

Max

Maximized to full-screen size

This value is optional. If you omit this value, Normal is assumed.

Description

The MakeShortcut command creates a specified shortcut. The command returns True on successful execution, or False if an error occurs.

If you specify a shortcut that already exists, the command deletes and recreates the shortcut with the specified parameters.

Example
' Create shortcut "ABC.SPT" to be launched at
' Windows 7 startup
If  _OS_ = "WIN_NT6.1"  Then
     MakeShortcut(Cur_Startup, "ABC", _BIN_+"ABC.SPT" _
                   , , ,  _TEMP_, , , Min)
End If
JP1/Script version

Supported from JP1/Script 05-20.