Process given menuitem if true is returned. Allows the evaluation of arbitrary
expressions, e.g. if().
Default = true
Mode
mi, nm, ni, ns
Display menuitem by type of selection. The value has one of the following
parameters
(of type string):
none
Does not filter by selection. The menuitem is displayed for any selection, like multiple.
single
Display menuitem when there is a single object selected, or for the background of a folder or the desktop.
multi_unique
Display menuitem when the selected objects are all of the same type
and, for files, all have the same file extension. Also displayed for a single object.
multi_single
Display menuitem when the selected objects are all of the same type.
Files may have different extensions. Also displayed for a single object.
multiple
Display menuitem for any selection.
Each mode is an upper limit, not an exact match: a single object and the background pass every mode,
and an empty selection passes every mode except single.
To limit a menuitem to the background or to some kinds of objects, use type,
for example type = 'file|dir'.
The taskbar menu ignores mode.
Default = single
Type
mi, nm, ni, ns
Specifies the types of objects for which the menuitem will be displayed.
Possible values are shown below. Separate multiple types with the pipe character (|),
in
which case the menuitem is displayed if any of the given types is matched.
To exclude a given type, prefix its value with the tilde character (~).
Expressions are not supported with this property.
*
Display menuitem when any type is selected.
File
Display menuitem when files are selected.
Directory(Dir)
Display menuitem when directories are selected.
Drive
Display menuitem when drives are selected.
USB
Display menuitem when USB flash-drives are selected.
DVD
Display menuitem when DVD-ROM drives are selected.
Fixed
Display menuitem when fixed drives are selected. Such drives have a fixed media; for
example, a hard disk drive or flash drive.
VHD
Display menuitem when Virtual Hard Disks are selected.
Removable
Display menuitem when the selected drives have removable media; for example, a floppy drive,
thumb drive, or flash card
reader.
Remote
Display menuitem when the selected remote (network) drives are selected.
Back
Display menuitem when the background of all types are selected (back). Or
specify one of
the following more granular types for the background:
back.directory
back.drive, including
back.fixed
back.usb
back.dvd
back.vhd
back.Removable
back.namespace, including
back.computer
back.recyclebin
Desktop
Display menuitem when the Desktop is selected.
Namespace
Display menuitem when Namespaces are selected. Can be virtual objects such as My Network Places and Recycle Bin.
Computer
Display menuitem when My Computer is selected.
Recyclebin
Display menuitem when the Recycle bin is selected.
Taskbar
Display menuitem when the Taskbar is selected.
Default = Accepts all types, except for the Taskbar.
Apply the current item's process instructions to any existing menuitem if their title property matches the
pattern of the current item's find property.
For dynamic items (optional)
Display the current menuitem if the pattern of its find property matches the
path name or path extension
of the selected files.
Default = null, which means any string is "matched".
where %pattern% can be one or
more
matching instructions (see Examples below). The
following characters do have special meaning:
|Use to separate patterns. If any one pattern
matches,
the property yields
true.
*Matches any number of characters. Is used as a
wildcard
to
match only the beginning or the end of the entire string (or word, if used in
combination with the exclamation mark !).
!Negates the match of the current pattern, or
limits
the wildcard (*) to one word only.
"" the enclosed string is treated as a word.
A word is a sequence of
alphanumerical characters that is confined to the left and to the right by either a
space
, a non-word character (e.g. / or -), or the
beginning or the end of the entire string, respectively.
Examples
Pattern
Matches any string that ...
Would match
Would not match
'foo'
contains the literal string foo anywhere.
foo, foobar, afoobar
fo, f oo, bar
'"foo"'
contains the literal string foo as a whole word
only.
foo, foo/bar, some foo bar
foobar, foofoo, bar
'*foo'
ends with the literal string foo.
foo, barfoo, bar/foo
foobar, fooo, foo
'foo*'
starts with the literal string foo.
foo, foobar, foo/bar
foobar, fo, yeti
'!foo'
does not contain the literal string foo anywhere.
fobar, fo, kung-fu
foo, foobar, barfoo/bar
'!"foo"'
does not contain the word
foo
fobar, kung fu bar, foobar
foo, kung foo bar, bar/foo/bar
'!*foo'
does not contain a word ending on
foo
foobar, fooo-fo
foo, foo bar, bar/foo
'foo*!'
does not contain a word starting with
foo
myFooBar, barFoo
foo, foobar, fo-fooo
For dynamic items the following syntax allows to match against file
extensions:
Pattern
Matches any file extension ...
Would match
Would not match
'.exe'
equal to .exe
setup.exe, notepad.exe
install.bat, shell.nss, shell.ex_,
file
without an extension.
'!.exe'
not equal to .exe
setup.exe.zip, video.mp4, shell.ex_,
file
without an extension.
setup.exe, shell.exe
'.exe|.dll'
equal to either .exe or .dll
shell.exe, shell.dll
shell.zip, shell.nss, file
without an extension.
In
mi
Specifies the existing submenu where the modify target is located.
Syntax
in = "New"in = "Sort By"
Menuitem Properties
This set of properties describe the appearance and location of a given menuitem. For modify-items, this is the target menuitem. For dynamic entries, this is the newly created menuitem.
The icon that appears in a menuitem. This property can be assigned as image files,
resource icons, glyph
or color. With one of the following parameters
null
Show menuitem without icon.
Inherit
@*Inheriting the image from the parent.*@
Inherits this property from its parent item.
Cmd
Assign image from the command property.
Glyph
Assign image as Glyph.
Color
Assign image as color.
Path
Assign image from location path or resource icon.
Note:The value Cmd is not available for modify-items
targets.
Name the menu by its title, or a path of titles such as 'Tools/More'. '/' is the
main menu. In modify(), an item that menu='/' puts in (or keeps in) the main
menu stays there: the modify rules after it don't move it again.
The menu can be one of yours with expanded=1: the Windows items
modify(find='copy' menu='Tools') moves into it then show in its place, next to its own items.
Default = null
Checked
st, ni
Type of select option:
0
Not checked
1
Display as check mark.
2
Display as radio bullet.
Default = 0
Default
st, ni
Specifies that the item is the default. A menu can contain only one default
menuitem, which is displayed in bold. If more than one item in the same menu sets it, only the first one is used.
Accepts true/false or an expression, for example default=sel.count==1. Writing default on its own means default=true.
tip = "Lorem Ipsum is simply dummy text."tip = ["Lorem Ipsum is simply dummy text.", tip.info]
tip = ["Lorem Ipsum is simply dummy text.", tip.info, 1.2]
Command Properties
This set of properties describe how a command is executed. Only available for dynamic items.
The command associated with the menuitem. Occurs when the menuitem is clicked or
selected using a shortcut key or access key defined for the menuitem.
cmd-ps= (or cmd-powershell=) runs a PowerShell script, and cmd-pwsh=
runs it with PowerShell 7. The script can have several lines; switches such as -NoExit or
-ExecutionPolicy Bypass can go before it.
item(title='Free space on C:' cmd-ps=`-NoExit
$d = Get-PSDrive C
Write-Host ([math]::Round($d.Free / 1GB)) 'GB free'`)
Default = null
Arguments (arg, args)
ni
The command line parameters to pass to the command property of a menuitem.
Default = null
Invoke
ni
Set execution type
0, single
execute the command only once in total. The list of selected
items can be accessed with @sel
1, multiple
execute the command once for every single item in the current
selection. The currently processed item can be accessed with e.g @sel.path.quote
Default = 0
Window
ni
Controls how the window of the executed command is to be shown. Can be one of the following
parameters:
Hidden, Show, Visible,
Minimized, Maximized
Default = show
Directory (dir)
ni
Specifies the working directory to
execute
the command in.
Default = null
Admin
ni
Execute the command
with administrative permissions.
Default = false
Verb
ni
Specifies the default operation for the selected file. Value type string
and can have one of the following parameters:
null
Specifies that the operation is the default for the selected file type.
Open
Opens a file or an application.
OpenAs
Opener dialog when no program is associated to the extension.
RunAs
In Windows 7 and Vista, opens the UAC dialog andin others, open the Run as... Dialog.
Edit
Opens the default text editor for the file.
Explore
Opens the Windows Explorer in the folder specified in Directory.
Properties
Opens the properties window of the file.
Print
Start printing the file with the default application.