Log in

View Full Version : Open with++ Shell Extension


stax76
15th March 2019, 23:01
Project page:

https://github.com/stax76/OpenWithPlusPlus

StainlessS
16th March 2019, 10:51
If you are looking for freeware software which site do you go to?

I like FileHippo.

I recently wanted to find Windows v3.1 SDK and found it difficult to locate until I came upon "http://devel.archefire.org", where it resides along with much other stuff.
[A Liniux style repository, some preference to what looks like Italian (or maybe Spanish/Portuguese, as well as English).]
http://devel.archefire.org/files.php?file=/

EDIT: Here the SDK (get the 7z, the other is expanded files):- http://devel.archefire.org/files.php?file=/compilers/Windows/_TOOLS_
[Edit: In the SDK, can expand files ending in "_" via 7zip, they are CAB files, without the '.Cab' extension.]

stax76
17th March 2019, 17:11
The last couple of years I wasn't looking for software that much, the only site I visit from time to time is https://alternativeto.net where I submitted Open with++ as alternative for Open++.

stax76
18th March 2019, 08:30
There was a problem on Win 7 causing an error on startup, it's fixed in the latest realease. It has some minor new features and cosmetics included.

https://github.com/stax76/OpenWithPlusPlus

stax76
8th October 2019, 01:02
v2.0 is now available.

https://github.com/stax76/OpenWithPlusPlus

https://i.postimg.cc/JzShFD01/aaa.png

stax76
8th October 2019, 01:07
The forum software sucks for images and code on my setup, I've resized the image to 50% and still it breaks the page layout. I wish it could be fixed, most modern forum software don't have such kind of issue.

BetA13
8th October 2019, 18:59
hey stax76,

im not quite shure what exactly i can use this for.
Also, do you have an Description in German for this?

That would be very nice..

THX

stax76
8th October 2019, 23:18
Hello BetA13,

it does allow you to customize the context menu in Windows File Explorer. You can create your own menu items and define when they are shown, how they are shown and what they do when you click on them, the short answer is it runs a command line so basic command line knowledge is required.

StaxRip executes command line tools so working on that I learned the basics but really never embraced the command line concept, I never bothered to learn windows batch scripting and never will. Also for staxrip I needed a player with a decent command line interface and mpv was really the only player having that, so I started to learn mpv and this finally after 20 years opened my eyes on how powerful the command line is, so I started to embrace the concept and get serious on learning powershell.

When they are shown

It means you can define for which type of file or folder they are shown. You can define that the menu is shown for all file extensions or only for certain file extensions or for directories.

Example Visual Studio Code:

It's a really amazing text/code editor, there are too many file extensions for text files so it makes sense to show the menu item of Visual Studio Code for all files, even for mkv etc. To do this you enter *.* in the File Types field. Visual Studio Code allows you also to open a folder, it is useful for many types of projects and languages but also for any type of text file. It has a find in files feature that will search for a string in all files of the opened folder including all sub folders. There are tools like File Locator Pro that can do that too but why install an extra tool if you already have one that can already do the job. What will also work for this task is PowerShell:

PS1> Get-ChildItem -Recurse | Select-String regex

Trash\rename.ps1:1:$pattern = Read-Host -Prompt "Enter a regex pattern"


PS1> gci -rec | sls regex

Trash\rename.ps1:1:$pattern = Read-Host -Prompt "Enter a regex pattern"

To show a menu item for folders in Open with++ check 'Show for directories', the menu item will be shows if you right-click a folder or a folder background. My full definition for VS Code is:

Name: Visual Studio Code
File Types: *.*
Path: C:\Program Files\Microsoft VS Code\Code.exe
Arguments: %paths%
Show for directories: checked

How they are shown

This means simply either on top level or in a submenu which is called: Open with++

My most often used menu commands are:

Visual Studio Code
PowerShell
Copy Paths

Since I use these menu command very often I show them on top level instead of in the 'Open with++' submenu, other more rarely used menu command such as mkvtoolnix gui, mpc-be, mpc-hc, mpv, staxrip, virtualdub2, vlc etc. are in my 'Open with++' submenu because I use these commands not so often. What is on top level because I use it often is MediaInfo, for that I have my own frontend:

Name: MediaInfo
File Types: %audio% %video% %subtitle% %image% (that are macros defined in the options dialog, these macros are used for all menu commands that deal with audio, video, subtitle and image files)
Path: D:\Projekte\VB\StaxRip\bin\StaxRip.exe
Arguments: -mediainfo %paths%

I made some improvements to my MediaInfo frontend in recent staxrip beta builds.

Currently I'm working hard on improving my PowerShell knowledge so I have a PowerShell menu command on top level, to show it I right click a folder or folder background and select the command in the menu. Windows has that built in by pressing shift key. The definition for my powershell menu command is:

Name: PowerShell
Path: powershell
Arguments: -nologo
Show for directories: checked

That's all because 'Open with++' will set the working directory to the directory of the selected files or folders. If you want to use ancient legacy tech that never was any good then you can show the command prompt with:

Name: CMD
Path: cmd
Show in submenu: checked
Show for directories: checked

Windows Terminal Preview can be used like so:

Name: Windows Terminal
Path: wt
Show for directories: checked

Windows Terminal does unlike cmd and powershell not start with the proper working directory but it has a setting to make it work: "startingDirectory" : null

https://www.microsoft.com/en-us/p/windows-terminal-preview/9n0dx20hk701?activetab=pivot:overviewtab

Very often the file or folder paths have to be copied to the clipboard, this is especially true if you code, because of that Windows has that built pressing shift before you open the context menu, I don't want to use the shift key all the time so I have my own menu command:

Name: Copy Paths
File Types: *.*
Path: powershell
Arguments: -file "D:\Projekte\PS1\copy paths.ps1" %paths%
Show for directories: checked
Run hidden: checked

'Run hidden' prevents the terminal to be shown, for this task it's not that useful. The -File switch of powershell tells powershell to run a powershell script, when the -File switch is used powershell will exit afterwards, this can be prevented with -noexit switch or in code with things like Pause or Read-Host. The %paths% macros will expand to the selected files and folders, in powershell it can be accessed with the $args variable. The full code needed for the Copy Paths menu command is pretty simple:

Set-Clipboard ($args -join "`r`n")

What they do when you click on them

It runs a command line, for that you define a Path and Arguments. ShellExecuteEx is used to run it. The shell extension is done with C++ as dotnet is not suitable for it. The selected files and folders are available in the %paths% macro, it expands to "file1" "folder1" etc. It expands environment variables in the Path and in the Arguments. You can define 'Run as admin' or if you only sometimes need something running as admin you can press shift or control.

BetA13
9th October 2019, 00:05
Oh dear... Thanks for the description :)
I do not understand it all, but i think i do know what you use it for now..
The example with staxrip was good..
I think i can use this for some stuff...

Thank you for this deep description with some examples, that really helped me understand it a bit better.

Downloading now...
Tomorow im gonna take it for a testdrive :P

Thanks again for taking the Time and explaining it in that depth...


Best Regards...

stax76
9th October 2019, 01:53
You are welcome. What is the same topic is sometimes you want to delete context menu items that are defined in the Registry either by Windows or by an installed app. While it can be perfectly achieved with regedit it makes sense to do it with a powershell script. It's a relative easy task that is well suited to practice powershell. An example would be deleting the 'Edit with Paint 3D' menu item that is defined for jpg files. This can be achieved in one line:

Remove-Item "HKLM:\SOFTWARE\Classes\SystemFileAssociations\.jpg\Shell\3D Edit" -Force -Recurse

Saved in a powershell script (*.ps1) it can be executed every time Windows was installed. By default, ps1 files are opened with Visual Studio Code on my system, I find that the easiest way to execute a powershell script is using Open with++, for that I defined a menu command:

Name: Execute
File Types: ps1
Path: powershell
Arguments: -nologo -noexit -file %paths%

Also related is editing the New Menu, for that I coded a simple GUI app. This app is based on a brand-new and exciting platform called .NET Core 3.0, it is the successor of the .NET Framework, a brand that was discontinued in favor of the Core brand. Downside for users is that it's not yet part of the OS, but it will be in the future.

https://github.com/stax76/ShellNew

stax76
14th October 2019, 03:27
There was a bug in the search/filter feature, so I released a new version. I've also greatly improved the help content of the start page.

https://github.com/stax76/OpenWithPlusPlus

stax76
14th October 2019, 07:36
v3.0 fixes the terrible Win+X menu bug. :)

And the help content of the start page was further improved.

This tool is now complete.

https://github.com/stax76/OpenWithPlusPlus

BetA13
14th October 2019, 15:01
Thanks for the Update :)

*ThumbsUp*

redbtn
14th December 2019, 23:52
I get this error when i click Install. Dll is in folder.

https://t37.pixhost.to/thumbs/148/130047326_fs-2019-12-15-03-44-39.png (https://pixhost.to/show/148/130047326_fs-2019-12-15-03-44-39.png)

stax76
15th December 2019, 23:55
What does it say in English?

redbtn
16th December 2019, 00:36
What does it say in English?Can't load OpenWithPPShellExtention.dll

stax76
22nd March 2020, 05:41
@redbtn

The issue has been fixed meanwhile.


@all

Maybe somebody can suggest SetMenuItemBitmaps C sample code or whatever else API is needed to add icon support, I would like to support ico and exe files as source.

amichaelt
22nd March 2020, 19:22
@redbtn

The issue has been fixed meanwhile.


@all

Maybe somebody can suggest SetMenuItemBitmaps C sample code or whatever else API is needed to add icon support, I would like to support ico and exe files as source.

This has example usages:

https://docs.microsoft.com/en-us/windows/win32/menurc/using-menus

stax76
22nd March 2020, 20:06
Thanks, I can work with that. Probably more complicated than I expected but it's OK.

stax76
25th March 2020, 10:15
3.2.0.0 is available.

It supports icons using file types ICO, EXE and DLL, for EXE and DLL files a preview dialog shows asking for the index.

The working directory can be defined, previously this was always set to the directory of the selected files and folders.

Examples were improved, there is for instance one that shows how to execute a powershell script using the new Windows terminal.

https://github.com/stax76/OpenWithPlusPlus#execute-powershell-script-using-windows-terminal

Layout was improved.

Documentation was improved.

There is a Windows Terminal icon file included because wt.exe does not have one and the official one did not support the small menu size, I've saved it with IrfanView and after that it worked.


https://github.com/stax76/OpenWithPlusPlus

stax76
26th March 2020, 14:24
New version 3.3.0.0

If the sub menu is empty then it's not shown.

There is a new feature 'Show only if Ctrl key is pressed', the menu item is only shown when the Control key is pressed. To execute with admin rights the Shift key is now used.

The Open with++ GUI config app has now a new icon, it's very basic but maybe better than no icon.

https://github.com/stax76/OpenWithPlusPlus

stax76
17th June 2020, 18:49
3.7.0.0 fixes an issue that caused some menu items not working if the selection is more than 16 items.

https://github.com/stax76/OpenWithPlusPlus

amayra
22nd June 2020, 10:38
thank you for this awesome app

stax76
27th September 2020, 14:35
3.8.0.0


New Icon
Open with++ icon is shown in menu
Environment variables can be used in Path, Arguments, Working Directory and Icon
Open with++ location in environment variable %OpenWithPPDir%
New screenshot


https://github.com/stax76/OpenWithPlusPlus

stax76
2nd May 2021, 09:58
v3.9

- GUI redesign
- Relative paths
- Regex filters
- Fix 'Show only when Ctrl key is pressed'
- Tab order fix

https://github.com/stax76/OpenWithPlusPlus