Adding File Type Icons To SharePoint 2010

When uploading files to SharePoint libraries the correct icon may not be shown if it is not a common file type.  For example, I have created a library to store useful PowerShell scripts but as the file type is not known to SharePoint it shows a generic icon:

PowerShell_Icons_Before

To add custom file types, and show the correct icon in lists, simply locate an image file for the icon and follow these steps:

1. Save the image file for the icon to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Images on the SharePoint server

2. Edit the file docicon.xml located in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\XML and add the following entry into the <ByExtension> section:

<Mapping Key=”PS1″ Value=”ps1icon.gif” />

3. Restart IIS by running IISRESET from a command prompt.

The files should now be displayed with the correct icons:

PowerShell_Icons_After

Note: If your SharePoint environment consists of multiple servers you will need to carry out these steps on each server in the farm

[BlogBookmark] [Blogsvine] [del.icio.us] [Digg] [Facebook] [Furl] [Google] [LinkedIn] [MySpace] [Reddit] [Slashdot] [StumbleUpon] [Twitter] [Windows Live] [Yahoo!] [Email]