Skip to content
ikas edited this page Oct 7, 2024 · 27 revisions

Menu Icon

  • use icon from exe or dll

"C:\Program Files\7-Zip\7zFM.exe",0

C:\WINDOWS\System32\SHELL32.dll,196

note: change a folder icon and open desktop.ini(hidden) in the folder to find the index number https://support.microsoft.com/en-us/topic/cannot-change-the-default-folder-icons-in-windows-explorer-db49e15d-d95a-bc68-9947-e3ec296f4514

  • use icon file

"C:\Users\user\icons\icon.ico"

Menu Exe

run exe or script

# exe
"C:\Program Files\7-Zip\7zFM.exe"

# Environment variables are supported
"%LocalAppData%\Programs\Microsoft VS Code\Code.exe"

# script
newFolder.bat

run store app

# format
shell:AppsFolder\<Package Name>_<Publisher ID>!<App ID>

# For example: WindowsTerminal
shell:AppsFolder\Microsoft.WindowsTerminal_8wekyb3d8bbwe!App

# with parameters
start "" shell:AppsFolder\Microsoft.WindowsTerminal_8wekyb3d8bbwe!App new-tab -p "cmd"

URI protocols (limited)

# simple
"exe": "quick-look://",

# with parameters
"exe": "explorer",
"param": "quick-look://\"{path}\"",

Menu Param

The param template will be processed and passed to the [exe]

"{path}" 

If you right-click on the C:/Windows folder, the param will be "C:/Windows"

Supported variables

 {path} file absolute path
 {parent} file parent

 #single file only 
 {name} file name 
 {nameNoExt} file name without extension, version >=5.0
 {extension} file extension, version >=5.0

Match File

All (v5.0+)

match all file (not folder)

Extension Like

contains file extension

*            : all
.apkx .mapk  : xx.apk or xxx.apkx
empty        : all

Regex

  • Regex for file name
.+?\.txt

debug regex :https://regex101.com

Extension List (v5.0+)

must use | as delimiter

.apkx|.apk   : xxx.apkx or xxx.apk
.cpp|.java   : xx.java or xx.cpp

Match Folder

match all directory(v1.0-v4.0)

directory/desktop/directory background (v5.0+)

directory

right click on directory only

desktop

right click on desktop (right click on the explorer left tree desktop : bug)

background

right click on directory background

Match Multiple Files

Two modes are supported

  • EACH execute [exe] on each path
  • JOIN execute [exe] only once

note:
When [Multiple Files] is turned on, extension matching and folder matching are ignored

Multiple Files EACH Mode

For each file,pass [param] to [exe], same as single file

Multiple Files JOIN Mode

All paths will be connected according to the configuration,then as {path}

Path delimiter

If 2 files are selected: path1.txt path2.txt

delimiter: ,
result path: "path1","path2" 

note: Every path will be surrounded by quotes

Param

When multiple files are selected, the [Param] may be different
so, the [Param] can be overwritten here

about path in Param

First of all, when the path contains spaces,7z requires quoted path

When only one file is selected, by default, the path will not be quoted, we must add quotes manually
Param: "{path}"

When multiple files are selected, quotes are added to each path by default, we don't need to add quotes manually, we must override the [Param]
[Multiple Files] Param: {path}

Menu Cache

cache is used to reduce the slow loading caused by file io ?: see tip and cache time

Debug Helper

use customeContextMenuDebug.exe to show param
see json:
https://github.com/ikas-mc/ContextMenuForWindows11/blob/main/menuSample/Debug%20Echo.json

More Menu samples

https://github.com/ikas-mc/ContextMenuForWindows11/tree/main/menuSample

Menu Config Files Folder

C:\Users\yourname\AppData\Local\Packages\{appId}\LocalState\custom_commands   

If you need to back up, just copy all the files here to a safe folder.