Skip to content

Commit d6234e1

Browse files
committed
docs: shell.writeShortcutLink/readShortcutLink
1 parent ff5b804 commit d6234e1

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

docs/api/shell.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,36 @@ Move the given file to trash and returns a boolean status for the operation.
4848
### `shell.beep()`
4949

5050
Play the beep sound.
51+
52+
### `shell.writeShortcutLink(shortcutPath[, operation], options)` _Windows_
53+
54+
* `shortcutPath` String
55+
* `operation` String (optional) - Default is `create`, can be one of followings:
56+
* `create` - Creates a new shortcut, overwriting if necessary.
57+
* `update` - Updates specified properties only on an existing shortcut.
58+
* `replace` - Overwrites an existing shortcut, fails if the shortcut doesn't
59+
exist.
60+
* `options` Object
61+
* `target` String - The target to launch from this shortcut.
62+
* `cwd` String (optional) - The target to launch from this shortcut. Default
63+
is empty.
64+
* `args` String (optional) - The arguments to be applied to `target` when
65+
launching from this shortcut. Default is empty.
66+
* `description` String (optional) - The description of the shortcut. Default
67+
is empty.
68+
* `icon` String (optional) - The path to the icon, can be a DLL or EXE.
69+
Default is empty, which uses the target's icon.
70+
* `iconIndex` Integer (optional) - The resource ID of icon when `icon` is a
71+
DLL or EXE. Default is 0.
72+
* `appUserModelId` String (optional) - The Application User Model ID. Default
73+
is empty.
74+
75+
Creates or updates a shortcut link at `shortcutPath`. On success `true` is
76+
returned, otherwise `false` is returned.
77+
78+
### `shell.readShortcutLink(shortcutPath)` _Windows_
79+
80+
Resolves the shortcut link at `shortcutPath`, an object is returned with the
81+
fields described in the `options` of `shell.writeShortcutLink`.
82+
83+
An exception will be thrown when any error happens.

0 commit comments

Comments
 (0)