Here is a procedure that might come in handy when you, for some reason are required to re-install the binaries of the server.
Scenarios requiring this might include reverting to a previous state, fixing a corrupted farm, etc.
I have ran into those situations where if you simply click on uninstall would not do much good, so here is a manual removal procedure , should you need it:
First step (required if you want to recover your farm in a supported manner):
If you are able to do so, detach the server from the farm either using the SharePoint Configuration Wizard or by using psconfig –cmd configdb -disconnect
Disable and Stop MOSS Service on the server
-Microsoft Single Sign-on Service -Office SharePoint Server Search -Windows SharePoint Services Administration -Windows SharePoint Services Search -Windows SharePoint Services Timer -Windows SharePoint Services Tracing -Windows SharePoint Services VSS Writer
Note the following registry keys for the location where Sharepoint Binaries are installed :
HKLM\Software\Microsoft\Office Server\12.0 -InstallPath
(default is C:\Program Files\Microsoft Office Servers\12)
HKLM\Software\Microsoft\Shared Tools\Web Server Extensions\12.0 -Location
(default is C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12)
Delete the following registry hives:
HKLM\Software\Microsoft\Office Server\12.0 HKLM\Software\Microsoft\Shared Tools\Web Server Extensions\12.0 [x32] - HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\OSERVER [x64] - HKLM \SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\OSERVER
Delete the following folders: The value of the InstallPath key The value of the Location key C:\%CommonProgramFiles%\Microsoft Shared\SERVER12
Uninstall SharePoint using Windows Installer Cleanup utility:
Download the tool from http://support.microsoft.com/kb/290301
Install the tool on MOSS server and run the program from Start > All Programs > Windows Install Clean up
Select the entries that start with
“Microsoft Office SharePoint *.*” ,“Microsoft SharePoint Service *.*” and “Microsoft.Office*.*” having the same binaries version as the Server and select remove.
If you have Microsoft Office installed on the server, you may find other Microsoft Office Products to remove. Carefully select ONLY the ones having the same binaries version as the SharePoint Server and not the other ones.
Snags you may hit along the way:
Unable to delete some files in the SharePoint install location
As you correctly assume , this can happen if the files are somehow locked and you cannot get a handle.
A very useful tool to overcome the issue is Process Explorer
Open it, use the Find menu and check if the dll’s you are trying to delete are or not in use.If need be, kill the process locking them.
Once you are done, reboot the server and re-install the binaries.
Attach the server back to the farm.
How to remove Office SharepointServer 2007 on technet: http://technet.microsoft.com/en-us/library/cc262874.aspx
Hope this helps
Do you have updated guidance for this related to 2010 and 2013 versions?
Here are few other resources to remove SharePoint 2010 - if someone is looking:
Hope this helps!