Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: How do I associate extensionless files with an application?

14 Mar 2013   #1
drey

Windows 7 Ultimate x64
 
 
How do I associate extensionless files with an application?

This used to be simple to do in XP[1], but I can't figure out how to do it in Win7 (Ultimate edition).

Currently extensionless files open by default in notepad (yes I have the show file extensions option enabled).

When I try to use the Open With dialog to associate the Scite editor with such files, the Always use the selected program option is greyed out.

I've tried the XP trick of adding a . (dot) key in HKEY_CLASSES_ROOT. If I add the key OpenWithList to it, and then and a subkey scite.exe, the OpenWith context menu will show scite. But it still doesn't allow me to set it as the default viewer.

So how do I set scite.exe to be the default viewer for extensionless files?

[1]: Associate Extensionless Files with Notepad in WinXP : Perishable Press


My System SpecsSystem Spec
.
15 Mar 2013   #2
Brink

64-bit Windows 10 Pro
 
 

Hello Drey, and welcome to Seven Forums.

The file is going to need a file extension in order for to be able to be associated to be opened with a program of your choice.

You can do so by renaming the file to give it a file extension (ex: name.blank), then use Open with to select a program to always open it.

Hope this helps,
Shawn
My System SpecsSystem Spec
15 Mar 2013   #3
drey

Windows 7 Ultimate x64
 
 

Quote   Quote: Originally Posted by Brink View Post
The file is going to need a file extension in order for to be able to be associated to be opened with a program of your choice.
That wasn't true in XP, and there's likely a way to make it work in Win7. Extensionless files are common in Posix, e.g. README files, and some applications might require files to have a name without an extension. You can't always rename these files, for example they might be a part of a project in source code repository.
My System SpecsSystem Spec
.

15 Mar 2013   #4
Brink

64-bit Windows 10 Pro
 
 

If the file doesn't have a file extension, then you can still open them with any program you like, but they will not be associated to open with the program by default unless it does have a file extension.
My System SpecsSystem Spec
16 Mar 2013   #5
drey

Windows 7 Ultimate x64
 
 

Ok I figured it out thanks to a superuser answer. You have to associate the Open command with your editor of choice. Here's a sample registry file:

Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.]
@="txtfile"

[HKEY_CURRENT_USER\Software\Classes\txtfile\shell\open\command]
@="\"D:\\Apps\\Scite\\Scite.exe\" \"%1\""
I guess you could associate a different class for the extensionless file, but I use txtfile for simplicity.

Perhaps this could be added to the Tutorials section?
My System SpecsSystem Spec
16 Mar 2013   #6
Brink

64-bit Windows 10 Pro
 
 

I would think that would cause issues when you tried to open any .txt file since they would be opened by that program as well.

Otherwise, it would basically be the same as setting all .txt file types to open with that program in Default Programs.
Default Programs - Associate a File Type or Protocol
My System SpecsSystem Spec
16 Mar 2013   #7
Ztruker

Windows 10 Pro X64
 
 

Shawn, are you sure? When I look at my Win 8 system, there is no

HKEY_CLASSES_ROOT\.

There is a

HKEY_CLASSES_ROOT\*


so it seems like adding the registry data drey shows would work and not affect files with .txt extensions.

Guess I'll try it and see what happens.
My System SpecsSystem Spec
16 Mar 2013   #8
Brink

64-bit Windows 10 Pro
 
 

You're right Rich. I had thought that was a tiny * instead of . in the code box.
My System SpecsSystem Spec
16 Mar 2013   #9
Ztruker

Windows 10 Pro X64
 
 

That worked perfectly. I set it to use the X2 editor and when I double click on a file with no extension it opens in X2. When I click on a .txt file it opens in Notepad.
My System SpecsSystem Spec
Reply

 How do I associate extensionless files with an application?




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Can't associate icon with txt files
I use Editpad Lite and I can't get my Win7 starter to change the default txt icon. Editpad has a specific dialogue for changing it to the green Editpad icon. This doesn't do it. Had no trouble setting it on other pc's. But it is not only Editpad, the txt icon won't change regardless of what txt...
General Discussion
How do I associate .msp files to run using Windows Installer?
Trying to run a patch (.msp) for one of my s/w programs and this type of file is associated with PaintShopPro! Windows Installer is not in the list of programs to associate to this file type. Where is the .exe for it? Or how do I get it to appear in the list? I can't find it anywhere. It IS...
General Discussion
Adobe Acrobat won't associate with .pdf files
I have the latest Adobe Acrobat reader installed but whenever I double click a .pdf file Windows gives me the "this file does not have a program associated with it" message so I went to control panel>Default Programs and associated pdf files with acrobat , pressed OK then restarted the PC. The...
Software
Can't get Flash Player to associate with .swf files?
In my work environment, we have .swf files that when right-clicked to Open, are supposed to open in Adobe Flash Player. However my computer hasn't been completely set up. When I tried that, Win7 tried to open it with Winamp. Looked through my Start menu Programs and didn't see Flash Player. ...
Software
How to associate programs and files not in the list?
How do I associate a file extension with a program when the file extension and program soes not show up in the default list? I really can not find a way to type in the file extension (which in my case is . nms) with the program that open this file (nomes.exe) None of the turorials here seems...
General Discussion
Associate file type to xp mode application?
i have this seen before installing acrobat on my seven, while successful testing to use an old scanner and other hardware in the virtual xp, i had to install acrobat reader 5. suddenly all my pdf files, formerly with unknown icon had the old acrobat 5 icon and on double click the xp mode...
Virtualization


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 09:41.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App