0

I am trying to add something like right click "Edit" to open images in paint. In Windows 11 it says "Edit with Photos" so I tried to add a new entry. I can't get this to work. Any ideas?

Computer\HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell\Edit with Paint\command

"C:\Program Files\WindowsApps\Microsoft.Paint_11.2110.0.0_x64__8wekyb3d8bbwe\PaintApp\mspaint.exe" "%1"

enter image description here

1
  • Why are you adding your key in Computer\HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell? In Windows 10 adding it in HKEY_CLASSES_ROOT\Directory\Background\shell worked for me. Isn't this the case with windows 11 too? Commented Nov 15, 2021 at 4:14

3 Answers 3

2

There seems to be a bug that crashes MsPaint.exe when using it directly from context menu. See if you can find error logs in Event Log Viewer about MSPaint.exe exiting with exception code 0x00000004 on KERNELBASE.dll

A workaround is launching MSPaint.exe from PowerShell instead. Change the registry to the following:

powershell.exe -windowstyle hidden -Command "Start-Process mspaint.exe -Argumentlist '""%1"""'"

Make sure you enable mspaint.exe alias to make the command work. Otherwiese replace mspaint.exe with full program path.

The disadvantage of this workaround is that a PowerShell window will flash before MSPaint.exe launches. To overcome this, create a VB script as follows:

set WSShell=wscript.createobject("wscript.shell")
if wscript.arguments.count > 0 then
    FileName="""" & wscript.arguments(0) & """"
else
    FileName=Empty
end if
WSShell.run "C:\Windows\System32\cmd.exe /min /C ""start """" ""mspaint"" " & FileName,0

Put the script somewhere and change the registry to:

wscript.exe PATH-TO-VBS-FILE "%1"
0
0

In key "Computer\HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell\Edit with Paint\command" edit the default value and instead of "C:\Program Files\WindowsApps\Microsoft.Paint_11.2110.0.0_x64__8wekyb3d8bbwe\PaintApp\mspaint.exe" "%1" use "C:\Users\USERNAME\AppData\Local\Microsoft\WindowsApps\mspaint.exe" "%1" where USERNAME is your local account name.

0

Just an update for Windows 11 and to avoid the above Visual Basic workaround:

The response by user1257890 isn't wrong per se, but it's not fully explained. There is no longer a path in shell as they describe. Instead go to regedit and navigate to

Computer\HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell

Right click in the folder and click New, Key and name it "edit". Then inside of "edit", right click in the folder and click New, Key, and name it "command." Then, inside of command, right click on the object titled "(Default)" and click Modify, and click "C:\Users\USERNAME\AppData\Local\Microsoft\WindowsApps\mspaint.exe" "%1" .. Not as straightforward as their answer seems, but it's doable.

If you want to also remove Edit With Photos as an object, follow this guide: https://www.windowscentral.com/how-remove-edit-photos-and-edit-paint-3d-context-menu-windows-10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .