Downloads
93970.zip

I work in the small IT department of a bank that has 10 branches and almost 150 users. We run Windows Server 2003 Terminal Services and needed a way for all our users to read Microsoft Word and Excel documents. Our power users have Microsoft Office. But it wasn't economical to buy Office licenses for all our users, so we downloaded and installed the open-source OpenOffice productivity suite for all users who need to read Office documents but don't need to create them.

We thought our problem was solved. But we wanted files that have .doc and .xls extensions to open in Office for some users and in OpenOffice for everyone else, and our consultants explained that file associations are by machine rather than by user. Because we installed OpenOffice on a Terminal Services server, the file associations we specified would be the same for everybody on the server.

After receiving that disheartening news, I searched for and found registry subkeys that we could modify to let us do exactly what we wanted. Listing 1 shows OOFile.reg, a file I created to hold registry information that applies to OpenOffice users, and Listing 2 shows MSFile.reg, which contains similar information for Office users.

I added the code that Listing 3 shows to our logon script. That code first calls the IfMember utility from the Microsoft Office 2003 Resource Kit. IfMember determines whether the user who is logging on belongs to the OpenOffice user group. If so, the script uses regedit.exe (with the /s parameter for silent operation) to apply the OOFile.reg file; otherwise, the script applies the MSFile.reg file.

Everything is running smoothly. OpenOffice works nicely with Microsoft Office, and I saved the bank a lot of money.
—Terry Martin