CS-Script 3.20.0

Advanced Shell Extensions

One of the important components of the CS-Script integration with the OS is a set of Windows Explorer shell extensions. All of them can be enabled and disabled on individual base from the General page (Simplified Context Menus) of the configuration console.
These shell extensions are implemented as simple registry entries and appear on the root level of the explorer context menu:  

In addition to these simple shell extensions CS-Script (starting from v1.8.0) offers Advanced Shell Extensions.  This is a set of configurable batch file based shell extensions which can be modified and extended by user according his/her needs.  The Advanced Shell Extensions can be enabled/disabled form the configuration console.

By default Advanced Shell Extensions allow you to:

This is how Advanced Shell Extensions appear in windows explorer:

The major difference between simple and Advanced Shell Extensions is that advanced extensions are implemented as a COM server with dynamic behavior. This allows user to have highly structured explorer context menus by creating or modifying corresponding batch files.

User can alter shell extension without producing a single line of code. This includes:

The idea behind the Advanced Shell Extensions is simple: file structure and content of batch files controls appearance and behavior of the explorer context menu. The context menu on the image above is generated on the base of the following file structure:


Thus if you want to create menu item "Open in Notepad" in the root level of CS-Script shell extension you will need to create  "C:\cs-script\Lib\ShellExtensions\CS-Script\Open in Notepad.cmd" batch file containing the following text:
notepad.exe  %1
To ensure the menu item position you can preface the batch file name with two digit (##.) prefix which is not displayed at runtime. Also you can use suffix ".c" between file name and file extension to force the shell extension to display console window during the execution.

The best way to learn how to control Advanced Shell Extensions is to analyse existing batch files.

See Also

CS-Script Settings