Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 



How do I create a default association for files with an unknown extension?

RSS
Subscribe to Windows IT Pro | See More Registry Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

A. Files with an unknown extension will bring up an "open with" dialog when you double click on them however it is possible to associate an application with files of an unknown type.

You can force this using the registry:

  1. Start the registry editor (regedit.exe)
  2. Move to HKEY_CLASSES_ROOT\Unknown\shell
  3. From the Edit menu select New - Key
  4. Enter a name of 'open' and press Enter (don't type the quotes)
  5. Select the new 'open' key
  6. From the Edit menu select New - Key
  7. Enter a name of 'command' and press Enter (don't type the quotes)
  8. Double click the (Default) value
  9. Change to the application used to open, e.g. "NOTEPAD.EXE %1" for the notepad.exe application (you need %1 to pass the document name to notepad and depending on the application you may need %1 %*)
  10. Click OK

If you now double click on a file with no extension it will open with the application selected.

You can optionally delete the HKEY_CLASSES_ROOT\Unknown\shell\openas key and its content but it is not necessary and it will just remove the open with context menu option.

It is possible to just add a notepad option to the context menu of Unknown by using the existing entry in HKEY_CLASSES_ROOT/Unknown/shell, adding a new key value of NotePad and a new Key value of 'open' underneath Notepad then a new Key called 'command' under open. Set the (Default) value of command to Notepad.exe %1. Registry file to perform this:

REGEDIT4

[HKEY_CLASSES_ROOT\Unknown\shell\notepad]

[HKEY_CLASSES_ROOT\Unknown\shell\notepad\open]

[HKEY_CLASSES_ROOT\Unknown\shell\notepad\open\command]
@="notepad %1"


End of Article



Reader Comments
Can the file association possible to link to java.exe with arguments ? if so how ?

darkestsky June 10, 2004


Has anyone had a problem with changing file associations with XP SP2? I just got a new laptop that came with SP2. When I started to associate my files to the apps I want to use, the files will not open. I get the hour glass and then nothing. Even going to Open With will not open the file in anything other than the app first associated with the extension.

Anonymous User December 02, 2004


You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

WinInfo Short Takes: Week of November 9, 2009

An often irreverent look at some of the week's other news, including some more Windows 7 sales momentum, some Sophos stupidity, Microsoft's cloud computing self-loathing, more whining from the browser makers, Zoho's "Fake Office," and much, much more ...

Where is Microsoft NetMeeting in Windows XP?

...


Related Events WinConnections and Microsoft® Exchange Connections

Deep Dive into Windows Server 2008 R2 presented by John Savill

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement