Link to home
Start Free TrialLog in
Avatar of MnInShdw
MnInShdwFlag for Japan

asked on

How to change bmp file association from registry?

Double clicking on a bmp file, launches the file in Windows Picture and fax viewer.
How can I change the default viewer for bmp (only bmp) files to MsPaint.

I know that I can do it from windows explorer's Folder Option or right click the file, select Open with...
from the context menu,  select MsPaint and check the checkbox that says : always open with this application.

I NEED to have a *.reg file to double click it to change the bmp files' association to
MsPaint and another one to reset it (change it to Windows Picture and Fax Viewer).

Any kind of quick help is much appreciated.
Avatar of RubixcubeSupport
RubixcubeSupport

Try this website: http://www.dougknox.com/xp/file_assoc.htm
It doesn't have one for a BMP file unfortunately, but try editing it in notepad.
Avatar of matrixnz
Export the following two keys from your system, once before the change and another afterwards, combine the two key sets i.e. the two for Paint Shop and the other two for Windows Picture and Viewer, to make one one reg file for each product.

1. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp\
2. HKEY_CLASSES_ROOT\.bmp\

Cheers
Sorry I meant MSPaint not Paint Shop :-)

Cheers
If you wish to make it a little easier download the following program
AutoIT 3.0 from here http://www.autoitscript.com/autoit3/downloads.php

Once installed, copy the script below into notepad and save as bmpext.au3.  Now right click bmpext.au3 and select compile to exe, this will create an executable for you, just double click and it will either enable MSPaint or Microsoft Windows Picture and Viewer.

Cheers

AutoItSetOption ("ExpandVarStrings" , 1)
AutoItSetOption ("TrayIconHide" , 1)

$MSPaintReg = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp", "Application")

If $MSPaintReg = "mspaint.exe" Then
    RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp", "Application")
      MsgBox(0, "BMP Extension", "Windows Picture and Fax Viewer Associated")
EndIf

If NOT $MSPaintReg = "mspaint.exe" Then
    RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp", "Application", "REG_SZ", "mspaint.exe")
      MsgBox(0, "BMP Extension", "MSPaint Associated")
EndIf
Avatar of MnInShdw

ASKER

matrixnz
Million thanks for trying to help

Unfortunately I wasn't able to make your first suggestion work for me.
Am I missing something? It's what I did :

I exported the 2 reg keys and merged them while the default program for bmp files
was Picture viewer, named it fax.reg.
Then right clicked a bmp file, selected Open with and then choose program, selected
MsPaint and checked "Use this program to open this kind of file"
Once the default program changed to MsPaint, exported the 2 keys again, merged
them and named it paint.reg

Now I'm following your autoit3 solution.

Once again thanks for your time


I downloaded autoit and followed you.
Second time of double clicking  the exe file gives me this message :
MSPaint Associated but still the bmp file association hasn't changed.

I tested it on 3 PCs but it seems it doesn't work for me. Does it work for you?
when I click a bmp file, it still opens in Windows Picture and Fax Viewer.

Once again thanks for your help
Hi MnInShdw

Strange cause it works for me, can you try the following for me

Download RegShot http://regshot.blog.googlepages.com/regshot

a. Run Regshot
 b. Click 1st shot (Wait until Complete)
 c. Now Right Click a .bmp file
 d. Select Open With > Choose Program
 e. Check Always use the selected program to open this kind of file.
 f. Click Browse... or Select the correct Program from the list
 i. Click OK
 j. Now reselect Regshot from the taskbar
 k. Click 2nd shot (Wait until Complete)
 l. Click Compare

Can you post the results here.

Cheers
The compare result was too much and I preferred to keep it clean.
Here is the result :

http://kou.mninshdw.net/1.txt

thanks
ASKER CERTIFIED SOLUTION
Avatar of matrixnz
matrixnz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Works perfect.

Million thanks for your time and help.