UPDATE Found a crude and inelegant method, but it works!
Save this as paint.bat
somewhere in PATH, where it will be found by all users, such as C:\Windows:
@start /b "Paint" "c:\Program Files\Paint.NET\PaintDotNet.exe" %2
Save this as replace_mspaint_with_paintdotnet.reg
and merge it to the registry by double clicking on it with Windows Explorer (requires admin privileges):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\mspaint.exe]
"Debugger"="paint.bat"
Now using the Edit context menu on any of the usual image file types will use PaintDotNet instead MS Paint.
Stop reading now unless you're the type that likes gritty details.
Between the utilities listed in both of @Psycogeek's answers I got frustratingly close to a complete solution, but not close enough. I'm posting the partial remedy here in case someone else can provide the missing piece.
The autoruns
Image Hijacks tab shows programs which are pretending be their MS equivalents, popular examples using this method are Notepad2 replacing Notepad and Process Explorer replacing Task Manager.
2x-clicking on one of the hijacks, notepad2 say, opens the relevant entry in Regedit. I exported that key to disk, and then changed the notepad entries to paindotnet entries.
I merged that changed .reg file, refreshed Autoruns, and sure enough the new mspaint entry is there.
At this point any call which used to go to mspaint is now redirected to PaintDotNet.exe, yay! e.g.:
- Start > Run > mspaint
mspaint
in a command shell
- Select a foobar.jpg in Windows Explorer and use Edit context menu
C:\Windows\system32\mspaint.exe
from anywhere
Unfortunately, on every invocation Paintdotnet says The image type is not recognized, and cannot be opened. :( :(
Some testing in command line shell reveals I get the same error by passing empty quotes to PdN.
C:\> "C:\Program Files\Paint.NET\PaintDotNet.exe" " "
So I think for some reason the path of the target file is getting mangled before PdN sees it. I haven't been able to figure out how to see what PdN is actually getting, and therefore perhaps devise the final remedy.
Here is replace_mspaint_with_paintdotnet.reg
, which replaces mspaint.exe with PdN, and replicates the error above:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\mspaint.exe]
"Debugger"="\"C:\\Program Files\\Paint.NET\\PaintDotNet.exe\""
Use this debugging paint.bat
to capture the command line used to start the batch file in %TEMP%
:
@echo %* > "%temp%\%~nx0.txt"
@start /b "Paint" "c:\Program Files\Paint.NET\PaintDotNet.exe" %2
Adding a line like notepad %*
reveals that the image not recognised error is because in the first method PdN is trying to load the actual c:\windows\system32\mspaint.exe as an image and never sees any other parameters. For reasons I don't understand using %2
instead of the usual %1
in the batch file works, but not when PdN is called directly.
Whew! This was a tough one. Non-kludgy solutions which bypass the need for a batch file will be roundly appreciated. :)