[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 814
  • Last Modified:

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.
0
MnInShdw
Asked:
MnInShdw
  • 5
  • 4
1 Solution
 
RubixcubeSupportCommented:
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.
0
 
matrixnzCommented:
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
0
 
matrixnzCommented:
Sorry I meant MSPaint not Paint Shop :-)

Cheers
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
matrixnzCommented:
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
0
 
MnInShdwAuthor Commented:
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


0
 
MnInShdwAuthor Commented:
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
0
 
matrixnzCommented:
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
0
 
MnInShdwAuthor Commented:
The compare result was too much and I preferred to keep it clean.
Here is the result :

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

thanks
0
 
matrixnzCommented:
Doh sorry I posted the incorrect script, I had done a Ctrl+C earlier and then forgot to copy it after editing.

Try this au3 script instead.

Cheers

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")
      Else
    RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp", "Application", "REG_SZ", "mspaint.exe")
    MsgBox(0, "BMP Extension", "MSPaint Associated")
EndIf
0
 
MnInShdwAuthor Commented:
Works perfect.

Million thanks for your time and help.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now