There are a few upgrade options available when planning to move to Office 2010 from a previous version. Microsoft has a technet article that touches on these various options here:

Plan an upgrade to Office 2010
http://technet.microsoft.com/en-us/library/ee624354.aspx

There are three options for upgrading to Office 2010:

  • In-place upgrade The earlier version of Office, such as the 2007 Microsoft Office system, is already installed on computers.
  • Uninstall upgrade The earlier version of Office, such as the 2007 Office system, is first uninstalled before the upgrade to Office 2010.
  • New operating system upgrade The computers get a new version of the operating system, such as Windows 7, and an upgrade to Office 2010.

One of the options that is discussed is performing uninstall-upgrades.

For a single machine this is pretty simple. Remove the previous version of Office via add/remove programs or KB290301, and then manually install Office 2010. For enterprise deployments though this gets to be trickier as these deployments will typically be automated. The purpose of this blog post is to demonstrate how to perform automated uninstall-upgrades.

The idea is that we will create a script that can automatically remove the previous version of Office, and then proceed to install Office 2010. To do this we need to first understand how to automate the removal Office 2003/2007. 

There are two methods for automating the removal Office 2003/2007.

1. Uninstall Office using the supported uninstall command line 
How to automate the uninstallation of Office 2003 products via command line
How to automate the uninstallation of Office 2007 products via command line

2. Uninstall Office by utilizing the Office removal tool. (Offscrub.vbs)
How to obtain and use Offscrub to automate the uninstallation of Office products

When choosing between which method to use for the automated removal of Office there are a couple things to consider.

If you choose to remove Office 2003/2007 with the command line uninstall option, keep in mind that the uninstallation could fail if the health of the product is poor. IE… if the source cache directory is corrupt, or if cached patches are broken. If you are removing Office 2007 and are wanting to have the uninstallation be silent, and you want to prevent the reboot, you will need to create a config.xml that contains those options and have it accessible on a share to call via the uninstall command line.

If you choose to remove Office 2003/2007 via the Offscrub technique, be familiar with the switches available for Offscrub and the FAQ.

Now that we know how we can automate the removal of Office 2003/2007 and we have decided on a method, we just need a script that can perform the uninstall actions, and then the install actions for Office 2010. 

For my examples below I am modifying the script from the technet article entitled Deploy Office 2010 by using Group Policy computer startup scripts. 
http://technet.microsoft.com/en-us/library/ff602181.aspx

*note*
If you decide to use GPO to deploy, make sure that you are familiar with the above article as there are some other considerations.
If you use this script, ensure that your share for Office 2010 doesn’t have any spaces. ie.. \\server\share\Office14
If you are deploying this script via a deployment mechanism that utilizes the SYSTEM account, make sure the system account can access the shares that are specified in the script.

In the example below, the script will first check to see if Office 2010 is installed, if it is not it will automate the removal of Office 2003/2007 via the uninstall command line, and then perform the installation of Office 2010.

Check for Office 2010, if not installed, uninstall Office 2007 via command line, and then after that is finished, install Office 2010.

uninstall-upgrade.bat

setlocal REM ********************************************************************* REM Environment customization begins here. Modify variables below. REM ********************************************************************* REM Get ProductName from the Office product's core Setup.xml file, and then add "office14." as a prefix. set ProductName=Office14.PROPLUS REM Set DeployServer to a network-accessible location containing the Office source files. set DeployServer=\\server\Office2010SourceFiles REM Set ConfigFile to the configuration file to be used for deployment (required) set ConfigFile=\\server\Office2010SourceFiles\ProPlus.WW\config.xml REM Set LogLocation to a central directory to collect log files. (the user doing the install needs write access) set LogLocation=\\server\Office2010LogFiles REM ********************************************************************* REM Deployment code begins here. Do not modify anything below this line. REM ********************************************************************* IF NOT "%ProgramFiles(x86)%"=="" (goto ARP64) else (goto ARP86) REM Operating system is X64. Check for 32 bit Office in emulated Wow6432 uninstall key :ARP64 reg query HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432NODE\Microsoft\Windows\CurrentVersion\Uninstall\%ProductName% if NOT %errorlevel%==1 (goto End) REM Check for 32 and 64 bit versions of Office 2010. (Office 64bit would also appear here on a 64bit OS) :ARP86 reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%ProductName% if %errorlevel%==1 (goto DeployOffice) else (goto End) REM If 1 returned, the product was not found. Run setup here. :DeployOffice start /wait \\server\share\Office12\setup.exe /uninstall ProPlus /config \\server\share\UninstallConfig.xml start /wait %DeployServer%\setup.exe /config %ConfigFile% echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt REM If 0 or other was returned, the product was found or another error occurred. Do nothing. :End Endlocal

If we wanted to use Offscrub.vbs to perform the uninstall we could use the same script and just change the uninstall line for Office 2007 to use offscrub rather then the uninstall command line.

Check for Office 2010, if not installed, uninstall Office 2007 via Offscrub2007.vbs, and then after that is finished, install Office 2010.

uninstall-upgrade.bat

setlocal REM ********************************************************************* REM Environment customization begins here. Modify variables below. REM ********************************************************************* REM Get ProductName from the Office product's core Setup.xml file, and then add "office14." as a prefix. set ProductName=Office14.PROPLUS REM Set DeployServer to a network-accessible location containing the Office source files. set DeployServer=\\server\Office2010SourceFiles REM Set ConfigFile to the configuration file to be used for deployment (required) set ConfigFile=\\server\Office2010SourceFiles\ProPlus.WW\config.xml REM Set LogLocation to a central directory to collect log files. (the user doing the install needs write access) set LogLocation=\\server\Office2010LogFiles REM ********************************************************************* REM Deployment code begins here. Do not modify anything below this line. REM ********************************************************************* IF NOT "%ProgramFiles(x86)%"=="" (goto ARP64) else (goto ARP86) REM Operating system is X64. Check for 32 bit Office in emulated Wow6432 uninstall key :ARP64 reg query HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432NODE\Microsoft\Windows\CurrentVersion\Uninstall\%ProductName% if NOT %errorlevel%==1 (goto End) REM Check for 32 and 64 bit versions of Office 2010. (Office 64bit would also appear here on a 64bit OS) :ARP86 reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%ProductName% if %errorlevel%==1 (goto DeployOffice) else (goto End) REM If 1 returned, the product was not found. Run setup here. :DeployOffice call cscript \\server\share\Offscrub07.vbs ProPlus /bypass 1 /q /s /NoCancel start /wait %DeployServer%\setup.exe /config %ConfigFile% echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt REM If 0 or other was returned, the product was found or another error occurred. Do nothing. :End Endlocal

These are example batch files. You could certainly create a VBS script, or use any other method of deployment that follows the same logic.
#1. Uninstall Office 2003/2007 using one of the available methods for automated uninstallation
#2. Wait for the uninstallation to complete.
#3. Install Office 2010.

FAQ

Will user settings still migrate if we are removing the previous version of Office 2003/2007 prior to installing Office 2010?
A- Any user settings that would migrate during a typical upgrade would still migrate when performing an uninstall-upgrade. The user settings will migrate upon the first user of each Office 2010 application.
http://technet.microsoft.com/en-us/library/ee624354.aspx#section2
The registry keys that are included or excluded when you use the in-place upgrade or the uninstall-upgrade option to migrate Microsoft Office 2003 or Office 2007 user data to Microsoft Office 2010 are listed in the following article.
http://technet.microsoft.com/en-us/library/ee624352.aspx

We are pushing the uninstall-upgrade using a deployment method that will perform the installation while a user is logged on to the machine. We have elected to use the Offscrub method and hide the CMD prompt window that Offscrub populates, but now find that there is no message to the user that the Office installation is taking place. Can we generate a notice to the users so they know that Office is being installed, and don’t try to shut down or disconnect the PC in the middle of the install?
A- It is not uncommon for folks to want to disable the command prompt window that Offscrub generates, because if that command prompt window is closed by the end user, than Offscrub will not complete. See Offscrub FAQ 

You can launch a custom IE window or a CMD window to act as the user notification if you wish. As an example, you could add the following to launch a nice notice to the user:

start "----NOTICE----" cmd.exe /t:ec /Q /k "echo OFFICE 2010 IS BEING INSTALLED. THIS WINDOW WILL CLOSE WHEN COMPLETE&&prompt $h"

Then after the install completes, close the CMD notification with:

XP
taskkill /IM cmd.exe /FI "WINDOWTITLE EQ ----NOTICE----"

Win7
taskkill /IM cmd.exe /FI "WINDOWTITLE EQ Administrator: ----NOTICE----"

So the portion of the install code above would look like this:

:DeployOffice
start "----NOTICE----" cmd.exe /t:ec /Q /k "echo OFFICE 2010 IS BEING INSTALLED. THIS WINDOW WILL CLOSE WHEN COMPLETE&&prompt $h"
call cscript \\server\share\Offscrub07.vbs ProPlus /bypass 1 /q /s /NoCancel
start /wait %DeployServer%\setup.exe /config %ConfigFile%
taskkill /IM cmd.exe /FI "WINDOWTITLE EQ ----NOTICE----"
taskkill /IM cmd.exe /FI "WINDOWTITLE EQ Administrator: ----NOTICE----"

echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt

*note*
I am using taskkill twice in my example to ensure that the notice window would close correctly in WinXp or Win7. (cmd.exe operates slightly different in newer operating systems). It is expected that one of the lines will fail silently.