List file extensions registered in the system
Q: Is there a simple way to list all the defined file types on a PC and have the output redirected to a text file? I’m using Windows XP with Service Pack 2.
Yes. There are two options that I think of (without using a third-party tool). If you’re using Windows XP Professional, you can use the ASSOC command to get the list of file types registered in the system, along with the ProgIDs. Click Start, Run and type:
Open filetypes.txt (present in your Desktop) using Notepad to view the contents. The output will look like this:
.323=h323file
.386=vxdfile
.3g2=Nokia.Multimedia
.3gp=Nokia.Multimedia
.a=
.aac=AudioManager.File
.aca=Agent.Character.2
.accdt=
.acf=Agent.Character.2
.acl=ACLFile
.acs=Agent.Character2.2
.act=actfile
USING A WMI SCRIPT
Here is a little WMI script that I wrote enumerates the HKEY_CLASSES_ROOT hive and stores the list of registered file extensions to a text file named FileTypesList.txt on the Desktop.
Option Explicit
Dim fso, b, objReg, strComputer, WshShell
Dim arrSubKeys, strKeyPath, subkey, strLogFile
Const HKEY_CLASSES_ROOT = &H80000000
Set WshShell = CreateObject("Wscript.Shell")
strLogFile= WshShell.SpecialFolders("Desktop") & _
"\FileTypesList.txt"
Set fso = Wscript.CreateObject("Scripting.FilesystemObject")
set b = fso.CreateTextFile (strLogFile,true)
b.Writeline "File types registered in the system"
b.writeblanklines 1
strComputer = "."
Set objReg = GetObject _
("winmgmts:{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\default:StdRegProv")
strKeyPath = ""
objReg.EnumKey HKEY_CLASSES_ROOT, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
If Left(subkey,1) = "." Then
b.writeline subkey
End If
Next
b.writeblanklines 2
b.Writeline "(Generated on " & Now() & ")"
b.close
WshShell.Run "notepad " & strLogFile, 1,True
Set fso = Nothing
set WshShell = Nothing
RUNNING THE SCRIPT
Copy the above code to Notepad and save the file as "filetypeslist.vbs". Then double-click the file to run it.
SAMPLE OUTPUT
.323
.386
.3g2
.3gp
.a
.aac
.aca
RELATED POSTS
- Error “This file does not have a program associated with it for performing this action” opening email attachments
- Fix: The default icon for .VBS files changed by Virus/Worm
- Add the “Open with Notepad” context menu option for all file types
- My Pictures, My Music and My Videos namespace extensions for the Windows Explorer folder pane
- Launching a Scheduled Task manually using Schtasks.exe
- OpenWithAdd 1.2 - Supports Windows Vista
- Default Programs list is completely empty
- How to set Firefox Portable as the default browser in Windows XP
- E-Mail selected text in a Web page using Snip IT Add-On for Internet Explorer
- How to Backup the Message Rules, Safe Senders and Block Senders list in Windows Mail
BOOKMARK THIS PAGE
BlinkList | del.icio.us | Digg it | Furl | ma.gnolia | Newsvine | reddit | Spurl | Wink |


If you enjoyed this post, make sure you
Prefer an E-mail subscription?