• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Registry file that makes a program default for .txt file extensions

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

c627627

c(n*199780) Senior Member
Joined
Feb 18, 2002
For the example of a simple Notepad-like text program, if you install it and make it the default program for .txt file extensions, what registry changes are made after you do that?
So in other words, if you fresh install it and then double click on a .reg file, the program would become the default program for opening .txt files.

Can anyone attach a Registry File to this thread that would accomplish that goal?
Thank you in advance if you know how to do it.
I would imagine just seeing the before/after registry differences would do it?

Here's the text editor: View attachment Spellpad Setup.zip
 

Janus67

Benching Team Leader
Joined
May 29, 2005
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\

I'd check there and point to your executable, or give that a shot. May have to create a key called 'UserChoice' to deviate from the standard.
 

JrClocker

AKA: JrMiyagi
Joined
Sep 25, 2015
It also may depend on the program. Newer programs don't use a lot of registry settings to store their configurations. It's usually stored in a configuration file (usually in the App Data folder under c:\users\user_name).
 
OP
c627627

c627627

c(n*199780) Senior Member
Joined
Feb 18, 2002
But those are individual program settings and configurations, inside a given program, right?

This is about setting the Windows OS default program for a .txt extension.
Doesn't Windows store the choice of a default program for an extension inside the registry?
 
OP
c627627

c627627

c(n*199780) Senior Member
Joined
Feb 18, 2002
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\

I'd check there and point to your executable, or give that a shot. May have to create a key called 'UserChoice' to deviate from the standard.

Tried and got this:

ChoiceTXT.png


I think there's more to it and you can't just double click a .reg file to set the default program for an extension.
 

Janus67

Benching Team Leader
Joined
May 29, 2005
I believe you're correct, from what I've read you have to take control/ownership of the reg key in order for it to work I think. Must be something windows does in the background (as system account most likely)
 
OP
c627627

c627627

c(n*199780) Senior Member
Joined
Feb 18, 2002
My first thought is to do that, but here's the background of my question.

If I don't want to make a program a permanent part of my Windows image, and if I image all the time, it takes a minute to setup a default program for an extension and to assign a custom icon for that extension. So every time I reimage, I install a program, that can't (yet) be part of an image, and I need to repeat the process.

I figured out a registry file which controls a custom icon, so that I can do with a single click.
But changing the default program for an extension I think cannot be done quickly... and by quickly I mean in a click or two.
 

Janus67

Benching Team Leader
Joined
May 29, 2005
I wonder how much of this could be scriptable with powershell/etc (rights, silent installs, registry injection, etc). May be worth looking into for something that you are doing a lot.