CreateShortcut
Go Up to Local GetIt Packages Actions Data Index
Creates a shortcut file.
Parameters
- Parameter 1: String. Target file path. Macros are allowed. Double quotes are needed when adding paths with parameters.
For instance:
"$(BDS)\bin\bds.exe" "-pdelphi"
Paths with parameters are allowed.
- Parameter 2: String. Shortcut destination. Macros are allowed.
- Parameter 3: Boolean. Optional. Flag to force directories (of parameter 2). If the directory does not exist, then it specifies if GetIt should create or not the directory before copying the file.
- The default value is
False
.
- The default value is
- Parameter 4: String. Optional. Shortcut description.
- Parameter 5: String. Optional. Shortcut icon. Macros are allowed.
Examples
- Example 1:
CreateShortcut("C:\windows\notepad.exe", "C:\Users\admin\Desktop\Notepad.lnk", False);
- Example 2:
CreateShortcut("C:\windows\notepad.exe", "C:\Users\admin\Desktop\Test\Notepad.lnk", True);
- Example 3:
CreateShortcut("C:\windows\notepad.exe", "$(_DESKTOP)\Notepad.lnk", True);
- Example 4: shortcut with parameters.
CreateShortcut('"$(BDS)\bin\bds.exe" "-pdelphi"', '$(_DESKTOP)\Test.lnk');
- Example 5: shortcut with description.
CreateShortcut('"$(BDS)\bin\bds.exe" "-pdelphi"', '$(_DESKTOP)\Test.lnk', False, 'Hello word');
- Example 6: shortcut with custom icon.
CreateShortcut('"$(BDS)\bin\bds.exe" "-pdelphi"', '$(_DESKTOP)\Test.lnk', False, 'Hello word', 'C:\dev\tp\images\AspNewContentPage_CS.ico');