Nilesoft Shell GitHub

Command line


shell.exe registers Shell with Windows File Explorer, restarts Explorer, prepares the per-user configuration and reports the state of an installation. Run it from the Shell program folder (C:\Program Files\Nilesoft Shell\ by default, or the folder you extracted the portable version to).

shell -[options]

Options start with - or / and are not case-sensitive. Run shell -? (or -help, -h) to show a short summary in a window. Without options (for example when you double-click it), shell.exe opens the app, NilesoftShellPro.exe in the same folder, or its own register and unregister window when the app isn't there.

Registering
-register (-r) Register Shell so Explorer loads it. Without -user this writes to HKEY_LOCAL_MACHINE for all users and needs an elevated command prompt.
-unregister (-u) Remove the registration. Without -user this needs an elevated command prompt.
-user With -register or -unregister: register for the current user only, under HKCU\Software\Classes. No administrator rights are needed. The icon overlay is machine-wide only and is skipped. If Shell is also registered for all users, the per-user registration takes precedence for that user.
-treat (-t) With -register on Windows 11: show the classic context menu, with Shell, instead of the modern one. With -user the redirect is written under HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}. -unregister always removes the redirect it added.
-restart Restart Windows Explorer for the current session so the change takes effect. Needs no administrator rights; other users' Explorer processes are not touched.
-silent (-s) Do not show message boxes. Use it from scripts.

-register, -unregister and -restart exit with code 0 on success and 1 on failure.

COMMAND PROMPT
shell -register -user -treat -restart
Administrator: Command Prompt
shell -register -treat -restart
Per-user configuration

Shell reads its configuration from the first of these that exists:

  1. the file named by the config value under HKCU\Software\Nilesoft\Shell (a relative path is taken from the program folder);
  2. %APPDATA%\Nilesoft\Shell\shell.nss;
  3. shell.nss in the program folder.

Imports are resolved relative to the importing file, so a per-user shell.nss uses the imports folder next to it. None of the -config commands need administrator rights.

-config:init [-force] Copy shell.nss and the imports folder from the program folder to %APPDATA%\Nilesoft\Shell. Existing files are kept unless -force (-f) is given.
-config:reset Copy everything in %APPDATA%\Nilesoft\Shell to a backup-<timestamp> folder inside it, then copy the default shell.nss and imports again, overwriting. Other files are left in place. Nothing is overwritten if the backup fails.
-config:path Print the full path of the configuration file in use.
-config:check <file> Parse <file> and its imports with the same parser Explorer uses, without affecting the running menu, and print the result as JSON. Exit code 0 if the configuration loads, 1 if it does not, 2 if no file is given.

The output of -config:check looks like this. Errors stop the configuration from loading; warnings (such as a missing import) do not.

{"ok":false,"root":"C:\\Users\\me\\AppData\\Roaming\\Nilesoft\\Shell\\shell.nss",
 "errors":[{"file":"...\\imports\\theme.nss","line":12,"column":9,"message":"..."}],
 "warnings":[]}
Status
-status Print one JSON object describing the installation. It only reads the registry and the file system and needs no administrator rights. Exit code 0, or 1 if the output could not be written. It cannot be combined with -config:*.

The object contains:

  • version, elevated, installDir and dll (path, and whether it exists);
  • registration.mode: none, user, machine or both, plus the DLL each registration points at;
  • win11: whether Windows 11 applies, whether the classic menu is active for this user, and the state of the machine and user redirects (absent, ours, foreign or inaccessible);
  • config: the configuration file in use and where it was found (registry, appdata, install or none);
  • userConfigDir: the per-user configuration folder.
Output
-out:<file> Write the output of -config:* and -status to <file> (UTF-8, replaced) instead of standard output.

shell.exe is a Windows program without a console of its own. Without -out, the output goes to standard output when that is a pipe or a file, otherwise to the console the command was started from. Because cmd.exe does not wait for Windows programs, that text can appear after the next prompt. Redirect it, use -out, or start it with start /wait when the order matters.

COMMAND PROMPT
shell -status -out:status.json shell -config:check "%APPDATA%\Nilesoft\Shell\shell.nss" > check.json
Tip: For installation steps with each package manager, see Installation.