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 make a dot file type recognized as a text file (e.g. .args)

04 Sep 2018   #1
trevorshiloh

Windows 7 Home Premium x64
 
 
How do I make a dot file type recognized as a text file (e.g. .args)

Hi,

I know in windows 7 you can create files without names such as ".args" or ".gitignore". I have one of each of these.



My question is, how does windows know that the .gitignore file is a "Text Document" and can I make the same thing happen to my .args file? If I make the default program notepad, the icon changes to this:



But windows still treats it as an "ARGS File" instead of a "Text Document".


Does anyone know how to get windows to recognize custom file types as text documents and for the .txt icon to be used?

Thanks.

Trevor


My System SpecsSystem Spec
.
04 Sep 2018   #2
samuria

win 8 32 bit
 
 

In simple terms Windows displays the icon for a file by what's designed to open it so if you tell Windows to open .Fred with notepad it then thinks it's a txt file. At a deeper level the headers of the file say what it is even a txt file can have different headers to say what type of txt file its and how it's encoded
My System SpecsSystem Spec
05 Sep 2018   #3
F22 Simpilot

Windows 7 Ultimate x64
 
 

I would just install Notepad ++ then all you have to do is right click the file and open with Notepad ++ to view that file. I do this all the time with many files. I even do it with pictures to look at its headers, etc.
My System SpecsSystem Spec
.

07 Sep 2018   #4
Alejandro85

Windows 7 Ultimate x64
 
 

There is no such thing in Windows like a "dot file" (or there is, but aren't special in any way). Windows Explorer uses the file extension to determine the "file type". Dot files are 100% extension, so each one is technically a different type. In your case the gitignore extension has a text file type, but the args extension had none, then the useless you created with the useless "default programs" Control Panel applet. As each file has different extension, each one is a different type.

To change this, look in the registry for the appropriate entries. Go to HKEY_CLASSES_ROOT\.gitignore and look at the "(default)" value. That's its current association. Copy that value into HKEY_CLASSES_ROOT\.args into its "(default)" entry and you're done, both files will behave the same. You'll need to restart Explorer in order for the change to take effect (usually, logoff and login again).


Quote   Quote: Originally Posted by samuria View Post
In simple terms Windows displays the icon for a file by what's designed to open it so if you tell Windows to open .Fred with notepad it then thinks it's a txt file. At a deeper level the headers of the file say what it is even a txt file can have different headers to say what type of txt file its and how it's encoded
It doesn't work that way. Windows Explorer has no idea of what program is designed to open what file. In fact it doesn't even opens the file, much less look at its headers (Linux does this partially with the shebang syntax). Explorer only relies on file extension to assing a "file type" according to the rules in the registry, and those rules define what program is launched on each action. Whether it's appropriate or not, it's not relevant, it's all about file association.
Nitpick: It's Windows Explorer what does all this, not Windows. The OS is utterly unaware and doesn't even cares about all this
My System SpecsSystem Spec
09 Sep 2018   #5
trevorshiloh

Windows 7 Home Premium x64
 
 

Thank you Alejandro for the in-depth analysis. Everyone else, thanks but my problem wasn't how to open the file in n++ or notepad etc, I wanted it to display nicely with the .txt icon, but the notepad icon.
My System SpecsSystem Spec
12 Sep 2018   #6
MourningStar

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Quote   Quote: Originally Posted by trevorshiloh View Post
... I wanted it to display nicely with the .txt icon, but the notepad icon.
most any file can have it's own custom icon, if that's you're ulterior goal.
My System SpecsSystem Spec
Reply

 How do I make a dot file type recognized as a text file (e.g. .args)




Thread Tools




Similar help and support threads
Thread Forum
File couldnot open because it is either not a supported file type
Hi, Good evening friends. I have been Using windows 7 for a long time for engineering design & documentation purpose for last 5-6 years, , but for last 3-4 days, i have been facing a very typical problem, when i am trying to open PDF or XLSX files stored previously, not opening by giving a...
General Discussion
Change File Associaton to Unknown File Type for .sdf file
I am using Windows 10 64 bit.At first the .sdf was not associated to any file type association like notepad etc.It was coming look for an app in store.I accidentally clicked on a file type association now can't find a solution to change it back to the default one(i.e pick an app from store) and...
Performance & Maintenance
Changing .exe File Type Icons In File Explorer But Nowhere Else
Hello Everyone, I have kind of an odd question, I have been looking into changing file type icons when I came across an interesting conflict. I would like to be able to change the file type icon for all .exe files to the same file type icon within a file explorer. If you were to try to do...
Customization
How do I change a file's file type (not only file association)?
I need to change a zip file to an epub file. I have heard this can be done, but when I add the .epub after the file name, I notice the file is still actually zip type file when I right click properties. This is causing a problem when I try to open it in in different ebook reader programs. I...
General Discussion
How to create a batch file that will move files based on the file type
How to create a batch file that will move files based on the file type? My Requirement : I need a batch file to copy all .doc files in all my HardDisk to a removable disk say (Z: drive) . Can anyone make it possible using a batch file?Please...Its urgent...
General Discussion


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 17:49.
Twitter Facebook Google+