Nilesoft Shell Pro GitHub

Context Menus


The Context Menus page turns whole parts of Shell's menu on or off: the bundled menus such as Terminal or Go to, and the rules that hide, move or rename Windows' own items. Each one has a switch, so you can try a change without editing any file. Nothing is deleted: turning something off comments its line out, and turning it back on gives you the original text.

It is also where you add your own .nss files without editing shell.nss, and where you choose the apps in the Apps submenu of the taskbar's menu.

The Context Menus page
Context Menus: the bundled modules and the rules for Windows' own items, each with an on/off switch.
Turn a module on or off

A module is a file that shell.nss imports. Each one adds a menu or a group of settings. The Modules list shows them in the order shell.nss imports them:

ThemeColors, fonts, spacing and effects of the menu. Off: Shell's built-in defaults.
IconsThe icon.* images the other files draw with. Always on: turning it off breaks them.
Windows itemsHides, moves and groups Windows' own items. Each rule is listed under Rules for Windows items.
TerminalCommand Prompt, PowerShell and Windows Terminal, opened in the current folder.
File manageCopy paths, change extension, select, take ownership, attributes, new folder and file.
DevelopOpen in an editor, dotnet commands. Shown while Shift is held.
Go toJump to common folders and Windows Settings pages.
TaskbarApps, window arrangement and Task Manager on the taskbar's menu.
My toolsNew file and System menus from Abdullah Masood's config.
Your menusThe menus and items you built on the Menu Builder page. Listed once you have saved there.
Open withEditors and terminals you picked on the Open with page. Listed once you have saved there.
Menu mapThe items you hid, renamed or moved on the Menu map page. Listed once you have saved there.

Any other file your shell.nss imports is listed too, by its file name, as Your own file, imported from <path>, whether you added it on this page or by hand. The settings written by the Appearance and Behavior pages are not a module and aren't listed.

To turn a module off:

  1. Turn off its switch. A small dot next to the name marks the change, and the top of the page shows how many files changed.
  2. Click Save. Discard undoes the changes you haven't saved.
  3. Right-click again to see the menu without it.

The file name at the right of each row (for example imports/goto.nss) opens that line in the Config Editor.

Add your own .nss file

If you wrote a .nss file, or got one from someone else, you can add it to your menu here instead of adding an import line to shell.nss yourself.

  1. Click Add a file… next to Modules and pick the file.
  2. It shows up at the end of the list with its own switch, and a dot marks it as not saved yet.
  3. Click Save. Shell checks the configuration with the new file in it first. If the file has an error, nothing is written and a message names the file and line.

A file that isn't in your configuration folder yet is copied into its imports folder (%APPDATA%\Nilesoft\Shell\imports), so the menu keeps working if the original is moved or deleted. If a different file of that name is already there, the copy gets a number, such as tools-2.nss. A file that is already in your configuration folder is used where it is.

The import line goes before the app's own files at the end of shell.nss, so the Appearance page's settings still come last:

import 'imports/tools.nss'
Remove one of your own files

Your own modules have an × button next to their switch. Shell's own modules don't: turn those off instead.

  1. Click ×. The app asks whether to remove the module.
  2. Tick Also delete the file if you don't need the file any more. Leave it unticked to keep the file in your configuration folder; you can add it again later.
  3. Click Remove, then Save.

The snapshot taken before the save has the file and the import line, so you can bring both back on the Backups page.

Choose the taskbar menu's apps

Right-click an empty spot on the taskbar and Shell's menu has an Apps submenu. Out of the box it has Paint, Edge, Calculator and Registry Editor. The Taskbar menu section lists what is in it, and you can make it your own launcher:

Add a program…Adds a program (.exe), a shortcut (.lnk), a script or any other file. The name comes from the program or the shortcut, and so does the icon.
Add an installed app…Opens a list of Windows' own apps (Notepad, Command Prompt, Device Manager…) and the apps in your Start menu, with a search box. Click one to add it. Apps that are already in the list are marked In the list.
Add a separatorAdds a line between groups of apps.

New entries go under the selected one, or at the end. Click an app to change it:

  • Name: the title in the menu. Leave the name of one of Shell's four apps as it is and it follows the language of your Windows.
  • Program: what the item opens. Browse… picks another file. A web address or a command such as calc.exe works too.
  • Arguments: added after the program, for example a file to open.
  • Run as administrator: Windows asks for permission each time.
  • Move up, Move down and Remove change the order or take it out.

Each entry has a switch: turn it off to hide an app without losing its settings. That is also how you hide Shell's own apps. If you removed one of them, add it back from Add an installed app…, under Windows.

Click Save, then right-click the taskbar to see the new list.

The list is saved in imports\settings-app-taskbar.nss in your configuration folder. imports\taskbar.nss reads that file in its Apps menu, and while the file exists, its apps are shown instead of the four built-in ones. To go back to those four, click Put back Shell's four apps under the list and save. The file is yours too: you can open it in the Config Editor and change it by hand. The page keeps what you wrote, including comments, properties it doesn't show (such as where= or keys=) and things it can't edit, such as a submenu. Those are listed as Written by hand; you can move or remove them here, and change them in the Config Editor. If the file has an error, the page says so and doesn't change it until you fix it.

What a switched-off app looks like in the file:

item(title="Notepad++" image cmd='@sys.prog\Notepad++\notepad++.exe')
// item(title=loc.calculator image= cmd='calc.exe')

If the section says The taskbar's menu doesn't show this list yet, either the Taskbar module is turned off above, or your imports\taskbar.nss is an older or edited copy that doesn't read the list. Take the new taskbar.nss from the config update on the Home page (your copy is kept in a backup), or open it with Open taskbar.nss and compare it with the one in the program folder.

Turn a rule for Windows' own items on or off

Shell can't remove Windows' own items from your PC, but its configuration can hide, move or rename them in Shell's menu. Those instructions are modify and remove rules. Rules for Windows items lists every one in your configuration, grouped by file, in plain words:

  • what it does, such as Hide, Move to “Pin/Unpin”, at the bottom or Rename to …;
  • which items it applies to, such as Restore previous versions, Cast to device;
  • when it applies, such as any selection or Recycle bin.

The bundled imports/modify.nss has eight rules. For example, one hides Restore previous versions and Cast to device, and two others group the Pin and Unpin items into a Pin/Unpin submenu.

  1. Find the rule and turn its switch off to stop it. The Windows item it hid comes back, or the item it moved returns to its usual place.
  2. Click Save.
  3. Right-click again to check the result.

line 12 at the right of a rule opens the file at that line in the Config Editor.

The Open with page writes remove rules too, for the items it hides, and they are listed here under imports/settings-app-openwith.nss. It's easiest to change those on the Open with page, which shows what each one is for.

Rules made on the Menu map page are listed under imports/settings-app-map.nss, and you can switch them off here too.

Why some switches can't be used

A greyed-out switch means the page can't turn that line on or off safely. The reason is shown under the rule, or in the module's description:

Icons is always onThe other modules draw their icons with it. Turning it off would break them.
Read-onlyThe file is the shared configuration in the program folder, or it is outside your configuration folder. Program Files is never written to. If Explorer uses the shared configuration, the page offers Create personal config, a copy in %APPDATA%\Nilesoft\Shell you can change.
Inside a menuThe rule is written inside a menu block. The page only switches rules written at the top level of a file.
Shares a line with other codeSomething else is on the same line, so commenting out the line would turn that off too. The same goes for a module whose import shares its line, or spans several lines.
Complex: edit it in the Config EditorThe rule uses a condition the page can't put into plain words, such as sel.count > 2. It shows the condition, and Items matching an expression when it can't tell which items are affected.

To change one of these, click its line link and edit it in the Config Editor.

What it writes

For the curious: turning something off puts // in front of its lines, which makes Shell skip them. A module's import line in shell.nss:

// import 'imports/goto.nss'

A rule that spans several lines gets // on each one:

// modify(mode=mode.multiple
// 	where=this.id(id.restore_previous_versions,id.cast_to_device)
// 	vis=vis.remove)

Turning it back on removes exactly those characters, so the file is the same as before, byte for byte. Nothing else in the file changes.

Where your changes are saved
  • Modules and rules have no file of their own. The page changes the files the lines are in: shell.nss for modules, and the file of each rule, such as imports\modify.nss. A file you add is copied into imports. The taskbar menu's apps go in imports\settings-app-taskbar.nss. Only files in your configuration folder (%APPDATA%\Nilesoft\Shell) are changed.
  • Before writing, the configuration is checked with shell -config:check. If it would fail to load, nothing is written and a message says what is wrong and where.
  • Each save first takes a snapshot in Backups, named after the changes, for example Context Menus: turn off Go to. To undo a saved change, restore the snapshot from before it, or simply turn the switch back on and save.
Troubleshooting
The menu didn't changeClose the menu and right-click again. If it still looks the same, use Restart Explorer on the Home page.
A Windows item is still there after turning a rule onThe rule may apply only in some places, such as a multiple selection or the Recycle bin; the line under the rule says when. Windows can also show the item under a different name than the rule looks for.
My Menu Builder items or Open with items disappearedYour menus or Open with is turned off in Modules. Turn it back on and save.
Not saved: the config would fail to loadAnother part of the configuration has an error that the change brings out. The message names the file and line; fix it in the Config Editor, or click Discard.
The file I added isn't in the menuCheck that its switch is on and that you saved. Its items may only show for some selections, or only on the taskbar; open it from the row to see.
The taskbar's Apps submenu didn't changeRead the warning in the Taskbar menu section, if there is one. Otherwise right-click the taskbar again, or use Restart Explorer on the Home page.
An app says Not foundIts program was moved or uninstalled. Select it and pick the program again with Browse…, or remove it.
The page doesn't show a rule I added by handOnly modify and remove rules are listed. If you added it while the page was open, save or discard your changes here, then switch to another page and back.