Uninstall Office 2010 starts, reboots pc and did nothing ?



  • Luke Nichols


    I am not sure where I got it from, but PDQ put out a PowerShell script a while ago that uninstalls all versions of Microsoft Office. You might want to try their PowerShell script and see if that works, although you should definitely run it on a test machine before you roll the script into production:



    AUTHOR: Kris Powell, Admin Arsenal
    DATE: 1/28/2016

    This will attempt to uninstall Microsoft Office for all versions. Please test in your environments before rolling out for production.

    Tested with Powershell v4


    $PatternProductID = '(?(?=^[^\.]+$)\S*|(?<=\.)\S*)'
    $xmlFile = "$env:TEMP\config.xml"

    $Installs = @()
    $Installs += Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" -ErrorAction SilentlyContinue | ? {$_.DisplayName -like "Microsoft Office*"} | ? {$_.PSChildName -match '^(?!{).*'}
    $Installs += Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*" -ErrorAction SilentlyContinue | ? {$_.DisplayName -like "Microsoft Office*"} | ? {$_.PSChildName -match '^(?!{).*'}

    $Installs | ? {$_} | % {
    $productID = $(if ($_.PSChildName -Match $PatternProductID) {$matches[0]} else {$_.PSChildName})
    If ($_.UninstallString -match "ClickToRun") {
    $UninstallString = "$($_.UninstallString) DisplayLevel=False"
    Else {
    ([XML] "
    <Configuration Product=`"$ProductID`">
    <Display Level=`"none`" CompletionNotice=`"no`" SuppressModal=`"yes`" AcceptEula=`"yes`" />
    <Setting Id=`"SETUP_REBOOT`" Value=`"Never`" />
    $UninstallString = "$($_.UninstallString) /config $xmlFile"
    $FilePathPattern = '"([^"]*)"'
    $FilePath = If ($UninstallString -match $FilePathPattern) {$matches[0]}
    $Arguments = $UninstallString -replace [regex]::Escape($FilePath), ""

    "{0,-15} {1}" -f "Program Name:", $($_.DisplayName) | Write-Output
    "{0,-15} {1}" -f "ProductID:", $(if ($_.PSChildName -Match $PatternProductID) {$matches[0]} else {$_.PSChildName}) | Write-Output
    "{0,-15} {1}" -f "Uninstall:", $UninstallString | Write-Output
    Write-Output ""
    Start-Process -FilePath $FilePath -ArgumentList $Arguments -Wait
    If (Test-Path $XmlFile) {Remove-Item $xmlFile}

    Comment actions Permalink
  • Seth

    Thank you for your response, i tried your powershell script this morning and it has the exact same behavior as my own uninstall string and the "official" package.

    The setup starts in the background, runs a minute or so then suddenly the pc reboots (normal restart) and nothing has changed.

    Powershell returned error code 1 (which i assume is because the pc restarted) and the outputlog just contains the standard uninstall string like i mentioned in my first mail.

    I can uninstall the office version perfectly when doing it manually through its uninstaller and even when i launch that very same command manually from the client pc itself.


    Now i tried yet another method where is used the offscub10.vbs script that microsoft itself uses to remove office 2010 in case of issues.

    I push it from a network location and the file does get executed without issues but after a minute or two the target pc gets rebooted.

    When i do the exact thing manually on the computer itself it uninstalls correctly.


    So now i'm thinking it is pdqdeploy that sends a reboot for some reason since it only happens when i push it through pdqdeploy.

    Comment actions Permalink
  • Seth

    I am trying the same vbs script now through psexec to push it to a target pc and the computer does not reboot.

    So it must be pdqdeploy for some reason ?

    Comment actions Permalink
  • Luke Nichols


    Could you please export the PDQ Deploy package that you are testing with and post it here?

    Comment actions Permalink
  • Seth

    i'll have to do it next monday, i'm not at the office anymore atm. But i'll keep you informed.

    Comment actions Permalink
  • Patrick Garber

    This is what I use. Make an xml file and put it in the same directory as setup.exe, run the package.

    In regard to your question about why it works locally for you but not through deploy, is probably something trying to run out of appdata directory. Antivirus could be preventing it or permissions on the remote machine. Or the file doesn't exist under the context of appdata for the user you are deploying as.


    <path to MS office package>\setup.exe /uninstall PROPLUS /config "SilentUninstall.xml" /dll OSETUP.DLL


    SilentUninstall.xml below

    <Configuration Product="ProPlus">

       <Display Level="none" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" />

       <Setting Id="SETUP_REBOOT" Value="NEVER" />


    Comment actions Permalink

Please sign in to leave a comment.