Vista tip of the week: Change file type associations on the fly

I received an interesting tip this week from Dan via email regarding removing and changing Windows Vista file type associations on the fly. I have to admit, I had never heard of this one:

You can remove a single file type association to more easily reassociate it. (You have to do this under admin rights, however.--Paul)

At a command prompt (cmd.exe) type assoc.file_type= Where file_type is the extension of the file type for which you want to remove the application association. As an example, you could stop PHP files from opening with WordPad by typing assoc.php= and then hitting Enter. The next time you open a PHP file, you will be prompted to choose a program again.

So this does work, but it's somewhat complicated. I recommend using the "Open with" trick instead. This can be used in two instances: When you want to change the association of a particular file type and when you want to just open a file with a different application on the fly. Here's how it works.

Locate the document or other file you'd like to open. Hold down the Shift key and right-click the file. You'll see a new option, Open With, appear. The Open With option will have a sub-menu associated with it. You can choose an option from this menu or select Choose Default Program.

From the Open With window, choose from the list of Recommended Programs. Or, click Browse to find a new program. When you locate a new program, it will appear in the Open With sub-menu and in the Open With dialog going forward. Note too the "Always use the selected program to open this kind of file." It's selected by default, so if you're not trying to change the association, make sure you uncheck it.

Discuss this Article 7

Flenser
on Jul 7, 2008
You don't need to hold down shift when you right-click. The Open With option is always available.
johnbaxter
on Jul 7, 2008
The shift key isn't necessary with right click in order to have "Open with..." in the menu. Shift does add other useful things, however, including the "Pin to Start Menu" you told us about before (Thanks!) , "Add to Quick Launch", "Open read only" (presumably only for a document, not an app). The menu on my machine is over an inch taller with shift than without. Right click for Open with also works in the old "who cares any more?" version of Windows. I could easily be convinced that it was in Win 9x--I learned about it long ago at the local computer club meetings. All that aside, it's really useful.
amanzi
on Jul 7, 2008
The big difference is that it's difficult to remove a file association in Vista using the GUI. For example, a while back I accidentally set Notepad to open *.ISO files. So all the ISO files had the little Notepad icon. I couldn't figure out how to remove this association, but I also didn't want to replace it with another association. That tip you provided would have worked in this case - useful little utility! >assoc /? 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.
BrightrevCarl
on Jul 7, 2008
This is actually a really cool tip. I've had file associations break on me and had a really tough time fixing them. Adobe PDF seems to be a particular culprit, with Acrobat 6, 7 and 8 and Adobe Reader 7 and 8 - sometimes in upgrading it just stops wanting to work right. Being able to just remove the association and start over is definitely a benefit.
jono1
on Jul 7, 2008
Is there any way in VIsta to get back the functionality to choose programs for different actions in the right click menu? For example, in XP I used to be able to set the default action for a .png file to open with Windows Picture and Fax Viewer, but have an option in the right click menu called "Edit" which would open it in Adobe Fireworks. I can't see any way to do that in Vista.
Sir_Timbit
on Jul 7, 2008
Is that per user, or would the assoc command set it for all users?
lotsamystuff
on Jul 8, 2008
Ah, used this very tip this morning, setting up some brand-spanking new Vista machines to use the preferred media player rather than the crap bundled one. The seminar facilitator I was working with was almost in a panic. It should come as no surprise that my Vista skills aren't up to par yet, so this was perfect timing. Thanks, Paul.

Please or Register to post comments.

IT/Dev Connections

Las Vegas
September 30th - October 4th

Paul ThurottYou'll have the opportunity to experience:
• 120 Technical
Sessions
• Networking with Peers
• Expert Speakers


Come See Paul Thurrott & Mary Jo Foley in Person!

Register Now

Office 365 InfoCenter

Get the latest insight and info from Paul

Read Now!

What I Use