Jump to content

set filetypes with the registry


Recommended Posts

i would like to set all my file types for all my media programs, winamp, real player, wmp10 ect through the registry so i don't have to set them up after each fresh install. what keys do i need to change to set file types. any suggestions on the easyest way to do this?

Link to comment
Share on other sites

Your best bet is to do a fresh install of windows, setup all of your filetypes and then export keys pertaining to your filetypes underneath HKEY_LOCAL_MACHINE\Software\Classes

So if you want to maintain winamp as your player for mp3 files, you would need to export 2 keys.

The first key to export is:


Then you need to look at either the exported file, or look in the registry at that entry. Under the first value (Default), you want to export whatever it says there:

HKEY_LOCAL_MACHINE\Software\Classes\<Default's value>


Under most systems, the default value for HKLM\Software\Classes\.mp3 is mp3file, so under most systems you would export HKLM\Software\Classes\mp3file, however on my system, because I have installed Yahoo Music Jukebox, the dafult value for HKLM\Software\Classes\.mp3 is YMP.Media, so on my system I need to export HKLM\Software\Microsoft\Classes\YMP.Media

Hope that helps.


NOTE: You should import this registry file at GUIRunOnce, so that the keys are setup _after_ the programs are all installed


Edited by Speeddymon
Link to comment
Share on other sites

You could also try the Assoc.exe using cmd promt

Displays or modifies file extension associations

ASSOC [.ext[=[fileType]]]

.ext Specifies the file extension to associate the file type with

fileType Specifies the file type to associate with the file extension

Type ASSOC without parameters to display the current file associations.

If ASSOC is invoked with just a file extension, it displays the current

file association for that file extension. Specify nothing for the file

type and the command will delete the association for the file extension.

Cmd to associate mp3 with winamp

assoc .mp3=Winamp media file
Here is a VBS script that demo the assoc

1:\ It run the assoc cmd on this made up extention .zzt

2:\ Checks for a file called Demo_ZZT.zzt

3:\ If it not there then it makes the file

4:\ Run the file

5:\ Removes the assco from the zzt extention and deletes the file

Save As Demo_Assoc.vbs

Dim Act : Set Act = CreateObject("Wscript.Shell")
Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim Ts
'/-> Assoc ZZT Extention
Act.Run("%Comspec% /c Assoc .zzt=txtfile"),0,True
Act.Popup "The file extention .zzt is now associated with txtfile", 5, "Completed", 0 + 32 + 4096
'/-> Checks For The Demo_ZZT.zzt Exists
If Not Fso.FileExists("Demo_ZZT.zzt") Then
Set Ts = Fso.CreateTextFile("Demo_ZZT.zzt") : Ts.WriteLine "Demo Assoc File type .ZZT" : Ts.Close
Act.Run("Notepad.exe Demo_ZZT.zzt"),1, True
End If
'/-> Remove Assoc From ZZT Extention Then Deletes The File
Act.Run("%Comspec% /c Assoc .zzt="),0,True : Fso.DeleteFile("Demo_ZZT.zzt")

Edited by gunsmokingman
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.

  • Create New...