https://nilesoft.org/
Very powerful, but not easy to use. No GUI. Need to read documentation and edit a configuration file.
Setup
Download and install Nilesoft Shell (NS).
You can edit NS configuration files in any text editor. I edit in LibreAutomate. If you'll use VSCode, install the NS formatter extension.
Create new empty NS configuration file somewhere not in the NS folder. For example file
Don't add more code in
Example: add menu items to run C# scripts in LA
More examples
I just started using Nilesoft Shell, and this is my
More info
To apply changes after editing, Ctrl+right-click in a folder window or desktop, taskbar.
If there are errors in
To temporarily disable the modified menu: Ctrl+Win+rightclick in a folder window. To enable: Ctrl+rightclick.
C# code "for each selected path" when code in the nss file is like
C# code "for each selected path" when code in the nss file is like
Very powerful, but not easy to use. No GUI. Need to read documentation and edit a configuration file.
Setup
Download and install Nilesoft Shell (NS).
You can edit NS configuration files in any text editor. I edit in LibreAutomate. If you'll use VSCode, install the NS formatter extension.
Create new empty NS configuration file somewhere not in the NS folder. For example file
My shell.nss
in LibreAutomate. Copy its full path. Open the NS folder, and open file shell.nss
in a text editor running as administrator (for example import as link in LA). Before line import 'imports/modify.nss'
insert line import 'the path'
. Example:...
import 'C:\LA workspace\files\Shell menu\My shell.nss'
import 'imports/modify.nss'
...
Don't add more code in
shell.nss
(NS setup deletes it). Keep your code in the new nss file.Example: add menu items to run C# scripts in LA
//Create submenu "LibreAutomate" and add some new items there.
// The `mode='multiple'` means "add it even if multiple files are selected". Child menu items inherit the mode and can override.
// The `mode`, `title`, `image` etc are documented in https://nilesoft.org/docs/configuration/properties
menu(mode='multiple' title='LibreAutomate' image='C:\Program Files\LibreAutomate\Au.Editor.exe')
{
//The menu command executes C# script "Shell menu script 1". The selected file path will be in `args[0]`.
item(title='C# script 1' mode='single' type='file' cmd='Au.Editor.exe' args='"Shell menu script 1" @sel(true)')
//The menu command executes C# script "Shell menu script 1". The selected file path will be in `args[1]`, and `"-example"` in `args[0]`.
item(title='C# script 1' mode='single' type='file'
find='.txt|.cs|.xml' //we can specify file types with `find` (simple) or `where` (supports expressions)
cmd='Au.Editor.exe' args='"Shell menu script 1" -example @sel(true)')
separator
//The menu command executes C# script "Shell menu script 2". File paths will be in the `args` array. Script example: foreach (var path in args) { print.it(path); }
item(title='C# script 2'
cmd='Au.Editor.exe' args='"Shell menu script 2" @sel(true)'
image=\uE150 //See https://nilesoft.org/gallery/glyphs. Or can be `image='path of ico, exe, png etc file'` etc.
tip="Example tooltip\nLine 2"
//Notes:
//Mode not specified, therefore this item inherits `mode='multiple'` from menu properties.
//Type not specified, therefore this item is shown for everything (files, directories etc) except taskbar.
)
}
More examples
I just started using Nilesoft Shell, and this is my
nss
file now.//In shell.nss import this file before `import 'imports/modify.nss'`.
// Example: import 'C:\LA workspace\files\Shell context menu\My shell.nss'
//Set dark theme.
theme
{
dark=true
}
//Remove useless/redundant menu items
remove(where=this.id(id.open,id.copy_as_path,id.extract_all,id.rotate_left,id.rotate_right,id.set_as_desktop_background))
//Why I remove them: Open - I double-click instead. Copy as path - see "File manage > Copy path". Extract all - I use 7-Zip.
//Move rarely used menu items to submenu "More options"
modify(where=this.id(id.add_to_favorites,id.print) menu=title.more_options)
//Add separator after Properties
modify(where=this.id(id.properties) sep=after)
//Create submenu "Cut etc" and move some items there. Instead I use hotkeys Ctrl+X etc, but not always.
// The `mode='multiple'` means "add it even if multiple files are selected". Default mode is `single`.
// The `mode`, `title`, `image`, `pos`, `where` etc are documented in https://nilesoft.org/docs/configuration/properties
menu(mode='multiple' title='Cut etc' image=icon.cut pos=bottom)
{
}
modify(where=this.id(id.cut,id.copy,id.paste,id.delete,id.rename) menu="Cut etc")
//Create submenu "LibreAutomate" and add some new items there.
// The `mode='multiple'` means "add it even if multiple files are selected". Child menu items inherit the mode and can override.
// The `mode`, `title`, `image` etc are documented in https://nilesoft.org/docs/configuration/properties
menu(mode='multiple' title='LibreAutomate' image='C:\Program Files\LibreAutomate\Au.Editor.exe')
{
//The menu command executes C# script "Shell menu script 1". The selected file path will be in `args[0]`.
item(title='C# script 1' mode='single' type='file' cmd='Au.Editor.exe' args='"Shell menu script 1" @sel(true)')
//The menu command executes C# script "Shell menu script 1". The selected file path will be in `args[1]`, and `"-example"` in `args[0]`.
item(title='C# script 1' mode='single' type='file'
find='.txt|.cs|.xml' //we can specify file types with `find` (simple) or `where` (supports expressions)
cmd='Au.Editor.exe' args='"Shell menu script 1" -example @sel(true)')
separator
//The menu command executes C# script "Shell menu script 2". File paths will be in the `args` array. Script example: foreach (var path in args) { print.it(path); }
item(title='C# script 2'
cmd='Au.Editor.exe' args='"Shell menu script 2" @sel(true)'
image=\uE150 //See https://nilesoft.org/gallery/glyphs. Or can be `image='path of ico, exe, png etc file'` etc.
tip="Example tooltip\nLine 2"
//Notes:
//Mode not specified, therefore this item inherits `mode='multiple'` from menu properties.
//Type not specified, therefore this item is shown for everything (files, directories etc) except taskbar.
)
}
//Create submenu "Edit with" and add some new items there.
// The `type='file'` means show the menu only for files but not for folders.
// The `find="..."` specifies file types for which to add the menu item.
menu(type='file' title='Edit with' image=icon.edit pos=top)
{
item(title='Dependencies'
type='file' find=".dll|.exe"
cmd='C:\Program Files\Dependencies\DependenciesGui.exe' args='@sel(true)')
item(title='PEView'
type='file' find=".dll|.exe"
cmd='C:\Program Files\PEview\PEview.exe' args='@sel(true)')
}
//Move some items to the "Edit with" submenu
modify(where=this.id(id.edit) menu="Edit with")
modify(find="Edit with *|Open with *" menu="Edit with")
//Move the "Open with" submenu to the top (after "Edit with")
modify(where=this.id(id.open_with) pos=top)
//I use app TreeSize to show folder sizes. It adds a menu item. But sometimes need to run it as admin. Therefore I replace that item with an item that runs TreeSize as admin. I could use the easy way (commented out below), but to avoid UAC consent screen I use a C# script instead.
remove(find="Scan with TreeSize*")
//item(title='TreeSize' type='dir|drive|back' image='C:\Program Files\TreeSize Free\TreeSizeFree.exe' cmd='C:\Program Files\TreeSize Free\TreeSizeFree.exe' args='@sel(true)' admin=true)
item(title='TreeSize'
type='dir|drive|back' image='C:\Program Files\TreeSize Free\TreeSizeFree.exe'
cmd='Au.Editor.exe' args='"Shell menu" "treesize" @sel(true)')
//Add some new items to menu "7-Zip".
// The `find="..."` specifies file types for which to add the menu item.
// The menu command executes C# script "Shell menu" and passes the selected file path and 2 more arguments to it.
item(title='Unzip'
type='file' find=".zip|.7z|.gz|.tar|.nupkg"
cmd='Au.Editor.exe' args='"Shell menu" "unzip" @sel(true) ""'
image=\ue202
move='7-Zip' pos=0)
item(title='Unzip and delete'
type='file' find=".zip|.7z|.gz|.tar|.nupkg"
cmd='Au.Editor.exe' args='"Shell menu" "unzip" @sel(true) "delete"'
image=\ue202
move='7-Zip' pos=1 sep=after)
More info
To apply changes after editing, Ctrl+right-click in a folder window or desktop, taskbar.
If there are errors in
nss
file text:- Shell writes an error line in file
shell.log
. To quickly access the file, you can import it in LA as link.
- Shell stops working (the right-click menu is unmodified). After fixing the error need to restart Explorer processes. Run
shell.exe
(the NS program file) and click Restart Explorer. Or runshell.exe -restart
.
To temporarily disable the modified menu: Ctrl+Win+rightclick in a folder window. To enable: Ctrl+rightclick.
C# code "for each selected path" when code in the nss file is like
args='"Script name" @sel(true)'
:C# code "for each selected path" when code in the nss file is like
args='"Script name" -example @sel(true)'
: