Ever since I blogged about my batch file to simplify the task of getting a PDF icon to display in SharePoint 2.0 document libraries back in October of 2004, it has been the single-most popular post on my blog (with almost 60,000 hits to date). Well, ever since Windows SharePoint Services 3.0 was released, I knew that I needed to update my batch file, it just wasn’t quite at the top of the to-do list. But now the wait is over – I have posted an updated package here.
Here’s the details and caveats regarding these files:
* The package (pdficon.zip) contains four files: pdf.png (the pdf icon), docicon_v2.xml (the updated docicon.xml file for WSS 2.0), docicon_v3 (the updated docicon.xml file for WSS 3.0) and pdficon.vbs (the VBScript that makes our lives easier )
* pdf.png is an updated PDF icon that is a little more current (basically, it doesn’t remind you of Acrobat 4.0 like the last one did)
* This is one of my first VBScripts, and as such I didn’t get some of the functionality in there that I would have liked to. Mainly, the script makes the assumption that your SharePoint installations were in the default locations (in C:\Program Files\…). Secondly, it is not localized – it’s specific to an English installation. If I actually get the time to learn some scripting, then maybe I can tackle those shortcomings.
* What the script DOES do is install the PDF icon for both SharePoint 2.0 and SharePoint 3.0. Basically, it looks to see if you have a docicon.xml file in the default WSS 2.0 directory. If so, it assumes that WSS 2.0 is installed, it renames your existing docicon.xml file to docicon.old, copies the docicon_v2.xml file as docicon.xml to the WSS 2.0 XML directory, and copies the pdf.png file to the WSS 2.0 images directory. It then does the same for WSS 3.0 – checks for the existence of docicon.xml in the default WSS 3.0 XML directory and if so, completes the required file operations. If it doesn’t find the docicon.xml file in either location, it doesn’t do anything. Finally, if it did find either WSS 2.0 or 3.0, it finishes up by doing an iisreset.
* The script will notify you with a message box when it completes, and it also writes a log file to C:\pdficon.log