Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


November 2004

WARNING: XP’s File Association Web Service May Be Dangerous to Your Organization’s Health

Getting into the “know enough to be dangerous” club just got easier for XP users
RSS
Subscribe to Windows IT Pro | See More Systems Administration Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Configuring File Associations for Users
For the OS shell to know which application to launch when you double-click a data file, two items must be defined: the file-extension key and the associated program class. Files are classified based on their extension (e.g., .doc, .xls), so files with the same extension are considered to be the same type or class. You can instruct the shell to open files of a given class with a specific application—this is known as association.

File-extension keys and program classes are stored in the registry in the HKEY_CLASSES_ROOT subtree. This subtree contains values from the HKEY_LOCAL_MACHINE\SOFTWARE\Classes subkey (which contains global settings) and the HKEY_CURRENT_USER\Software\Classes subkey (which contains individual user settings). If a value exists in both Classes subkeys, the user setting wins over the global setting.

You might be familiar with the GUI methods for associating a file type with a program. If you attempt to open a data file for which no association exists, you're presented with the Open With dialog box, which gives you the option of making your selected application the default association. You can also create file associations in Windows Explorer by selecting Folder Options on the Tools menu, then clicking the File Types tab. These methods are fine if you know what you're doing and you need to create the file associations on only a couple of systems. However, if you need to create file associations for a large group of users, you should familiarize yourself with two XP command-line tools: Assoc, which lets you create a file-extension key, and Ftype, which lets you create a program class.

Listing 1 demonstrates how to use these commands. The first line creates a file-extension key called .elog that has a value of CompanyName Text. In simple terms, Assoc is telling the OS shell that when it encounters a file with the .elog extension, it should refer to the CompanyName Text program class for instructions on how to open that file. The next two lines accomplish the same task for two other file extensions (i.e., .ref and .glo). Note that when you specify the program class name in Assoc and Ftype, you just need to use the friendly name. If necessary, you can elaborate on the name to avoid confusion by adding a period (.) followed by the qualifier (e.g., CompanyName Text.Logfile).

The last line in Listing 1 uses the Ftype command to create the CompanyName Text program class. The Ftype command accomplishes this task by creating the CompanyName Text subkey in the HKEY_LOCAL_MACHINE\SOFTWARE\Classes subkey. The value of the CompanyName Text subkey is the pathname of the executable file that will be used to open associated data files (in this case, C:\Program Files\Microsoft Office\Office\Winword.exe). The "%%1" parameter allows the data file to be passed to the executable as an argument; without that parameter, the application would open, but the data file that launched it wouldn't be loaded.

If you were to double-click a file with an .elog, .ref, or .glo extension after you ran the commands in Listing 1, Microsoft Word would open that file. You can add the Assoc and Ftype commands to a logon script or distribute the commands through other tools to provide consistent application usage among your users.

Note that the values you set using these commands will overwrite previous associations. So, if your users have made their own associations, you can still enforce your organization's standards. If you need to remove an association, it's easy to do so. For example, if you want to delete the .elog association, you'd run the command

Assoc .elog=

An Important Control
Although offering a Web-accessible repository of file extensions and possible associated applications is a noble concept, there are a few factors that make the file association Web service an unsatisfactory solution for end users and IT organizations. By disabling access to the file association Web service and configuring file associations for your users, you can head off frustration and wasted time for users and support staff alike.

Project Snapshot: How to
PROBLEM: If left enabled, XP's file association Web service can lead to frustrated users and numerous IT service calls.
WHAT YOU NEED: XP's built-in Assoc and Ftype command-line tools
DIFFICULTY: 2 out of 5
PROJECT STEPS:
  1. Block the file association Web service by adding an entry in the registry.
  2. Configure file associations for files commonly used within your environment.



End of Article

   Previous  1  [2]  Next  


Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Learning Path For more tips about how to customize XP, check out this article:
"“Awesome Windows XP Tips”"


If you need detailed information about how the file association Web service works in XP and Windows 2003, see the following articles:
"“Using Windows XP Professional with Service Pack 1 in a Managed Environment”"

"“Using Windows Server 2003 in a Managed Environment: File Association Web Service”"


Top Viewed ArticlesView all articles
The Memory-Optimization Hoax

Don't believe the hype. At best, RAM optimizers have no effect. At worst, they seriously degrade performance. ...

The Desktop tab is missing from the Display Properties in Windows XP?

...

Microsoft's Olympic Gold

With world records being broken at a dizzying pace, the 2008 Summer Olympics in Beijing has drawn massive audiences from around the world, most watching the games via traditional TV coverage. But behind the scenes, a massive array of technology is ...


Windows OSs Whitepapers Replay for Exchange: Enterprise Protection and an Affordable Price

Are You Satisfied?

A Preliminary Look at Deployment Plans for Microsoft Windows Vista

Related Events 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 Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.

Job Openings in IT


ADS BY GOOGLE SPONSORED LINKS FEATURED LINKS

WinConnections Conference Fall 2008
Don’t miss the premier event for Microsoft IT Professionals in Las Vegas, November 10-13. Register and book your room by August 25 and receive a FREE room night (based on a three night minimum stay).

Deploying SharePoint! In-Person Event Series – 8 Cities
Discover best practices and tips for deploying the perfect SharePoint infrastructure. Early Bird Price of $99 extended till Sept. 15th.

Find a new job now on the all new IT Job Hound!
Search jobs, post your resume, and set up job e-mail alerts!

Master SharePoint with 3 eLearning Seminars
Learn how to build a better SharePoint infrastructure and enable powerful collaboration with MVPs Dan Holme and Michael Noel. Register today!

Top Tools for Virtualization Disaster Recovery & Replication
View this web seminar on August 14th to learn about two tools that will result in faster backup and restore with P2V disaster recovery.

SharePointConnections Conference Fall 2008
Don’t miss the premier event for Microsoft IT Professionals in Las Vegas, November 10-13. Register and book your room by August 25 and receive a FREE room night (based on a three night minimum stay).

VMworld 2008 - Sign Up Today!
Join your peers on September 15-18 at The Venetian Hotel in Las Vegas as VMware hosts VMworld 2008, the leading Virtualization event.



When managing just VMware isn’t enough
Plan/Manage/Secure – NetIQ VMware management. Download whitepaper.

What’s up with your network? Find out with ipMonitor
Availability monitoring for servers, applications and networks – FREE trial

Microsoft® Tech•Ed EMEA 2008 IT Professionals
Advance your thinking with new ideas and practical real-world solutions at Microsoft’s FIVE day technical infrastructure conference 3-7 Nov., 2008. Register before 26 September 2008 to save €300.

Order Your Fundamentals CD Today!
Gain an introduction to Exchange, learn server security requirements, and understand how unified communications can play a role in your messaging strategies with this free Exchange CD.

Are You Really Compliant with Software Regulations?
View this web seminar that will help you with compliance best practices and check out a management solution to assure that you won’t be in jeopardy of an audit.

Virtualization Congress Oct. 14-16 in London
Don't miss Virtualization Congress, the premiere EMEA conference dedicated to hardware, OS and application virtualization. Oct. 14-16 in London.
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 Windows Dev Pro IT Job Hound ITTV
IT Library Technical Resources Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing