This project is read-only.

OffScrub13.vbs Script Hangs

Topics: Archive - Deployment Scripts, Archive - General
Apr 20, 2015 at 4:30 PM
I have a problem with the OffScrub13.vbs script. It runs and I can track via event logs on the system that components are being uninstalled, Office 2013 is being uninstalled, etc. However, the process just runs and runs and runs. If I run the script standalone with the same exact commands that are in my Application it works without a problem.

Any suggestions? I have about 400 machines we are about to push the application to and half of those are Office 2013. I have been successful at killing the cscript.exe process on all the test machines and then the application continues without an issue.
Apr 20, 2015 at 11:24 PM
I had this same, look at Process Manager I bet cscript hang up your installation. I modficate my scripts and put older support files OffScrubsXX.vbs with date created 02-05-2014 (before I had a problem with new files with created date 12-2014).

I used for install Office 365 ProPlus ( works )

<#
.SYNOPSIS
This script performs the installation or uninstallation of an application(s).
.DESCRIPTION
The script is provided as a template to perform an install or uninstall of an application(s).
The script either performs an "Install" deployment type or an "Uninstall" deployment type.
The install deployment type is broken down in to 3 main sections/phases: Pre-Install, Install, and Post-Install.
The script dot-sources the AppDeployToolkitMain.ps1 script which contains the logic and functions required to install or uninstall an application.
To access the help section,
.EXAMPLE
Deploy-Application.ps1
.EXAMPLE
Deploy-Application.ps1 -DeploymentType "Silent"
.EXAMPLE
Deploy-Application.ps1 -AllowRebootPassThru -AllowDefer
.EXAMPLE
Deploy-Application.ps1 -Uninstall
.PARAMETER DeploymentType
The type of deployment to perform. [Default is "Install"]
.PARAMETER DeployMode
Specifies whether the installation should be run in Interactive, Silent or NonInteractive mode.
Interactive = Default mode
Silent = No dialogs
NonInteractive = Very silent, i.e. no blocking apps. Noninteractive mode is automatically set if an SCCM task sequence or session 0 is detected.
.PARAMETER AllowRebootPassThru
Allows the 3010 return code (requires restart) to be passed back to the parent process (e.g. SCCM) if detected from an installation.
If 3010 is passed back to SCCM a reboot prompt will be triggered.
.NOTES
.LINK

Http://psappdeploytoolkit.codeplex.com

"#>
Param (
[ValidateSet("Install","Uninstall")]
[string] $DeploymentType = "Install",
[ValidateSet("Interactive","Silent","NonInteractive")]
[string] $DeployMode = "Interactive",
[switch] $AllowRebootPassThru = $false

)

*===============================================

* VARIABLE DECLARATION

Try {

*===============================================

*===============================================

Variables: Application

$appVendor = "Microsoft"
$appName = "Office"
$appVersion = "365 Pro Plus"
$appArch = "x86"
$appLang = "PL"
$appRevision = "15.0.4711.1002"
$appScriptVersion = "1.0.1002"
$appScriptDate = "20/04/2015"
$appScriptAuthor = "Krzysztof Maczyński - modifications"

*===============================================

Variables: Script - Do not modify this section

$deployAppScriptFriendlyName = "Deploy Application"
$deployAppScriptVersion = "4.0"
$deployAppScriptDate = "20/04/2015"
$deployAppScriptParameters = $psBoundParameters

Variables: Environment

$scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Definition

Dot source the App Deploy Toolkit Functions

."$scriptDirectory\AppDeployToolkit\AppDeployToolkitMain.ps1"

Krzysztof M. fixing for detect correct

If ($(Get-WmiObject -Query "SELECT * FROM Win32_Processor WHERE AddressWidth='64'")) {
$dirOffice = Join-Path ${env:ProgramFiles(x86)} -ChildPath "Microsoft Office"
} Else {
$dirOffice = Join-Path ${env:ProgramFiles} -ChildPath "Microsoft Office"
}

Office Directory

$dirOffice = Join-Path ${env:ProgramFiles(x86)} -ChildPath "Microsoft Office"

*===============================================

* END VARIABLE DECLARATION

*===============================================

*===============================================

* PRE-INSTALLATION

If ($deploymentType -ne "uninstall") { $installPhase = "Pre-Installation"

*===============================================

# Show Welcome Message, close Internet Explorer if required, allow up to 3 deferrals, and verify there is enough disk space to complete the install
Show-InstallationWelcome -CloseApps "iexplore,PWConsole,excel,groove,onenote,infopath,onenote,outlook,mspub,powerpnt,winword,communicator,lync" -BlockExecution -AllowDefer -DeferTimes 3 -CheckDiskSpace

Check whether anything might prevent us from running the cleanup

If (($isServerOS -eq $true)) {
Write-Log "Installation of components has been skipped as one of the following options are enabled. isServerOS: $isServerOS"
}

# Display Pre-Install cleanup status
Show-InstallationProgress "Przygotowanie do usuwania starych wersji Office. To może zająć trochę czasu. Proszę czekać..."

Execute-Process -FilePath "msiexec.Exe" -Arguments "/X{95120000-003F-0409-0000-0000000FF1CE} /qn REBOOT=ReallySuppress" -ContinueOnError $true
Execute-Process -FilePath "msiexec.Exe" -Arguments "/X{90850409-6000-11D3-8CFE-0150048383C9} /qn REBOOT=ReallySuppress" -ContinueOnError $true
Execute-Process -FilePath "msiexec.Exe" -Arguments "/X{95140000-00AF-0409-0000-0000000FF1CE} /qn REBOOT=ReallySuppress" -ContinueOnError $true
Execute-Process -FilePath "msiexec.Exe" -Arguments "/X{90120000-0020-0409-0000-0000000FF1CE} /qn REBOOT=ReallySuppress" -ContinueOnError $true
Execute-Process -FilePath "msiexec.Exe" -Arguments "/X{90150000-0011-0000-0000-0000000FF1CE} /qn REBOOT=ReallySuppress" -ContinueOnError $true

Remove any previous version of Office (if required)

$officeExecutables = @("excel.exe", "groove.exe", "onenote.exe", "infopath.exe", "onenote.exe", "outlook.exe", "mspub.exe", "powerpnt.exe", "winword.exe", "winproj.exe")




ForEach ($officeExecutable in $officeExecutables) {
            If (Test-Path -Path (Join-Path -Path $dirOffice -ChildPath "Office12\$officeExecutable") -PathType Leaf) {
                Write-Log -Message 'Microsoft Office 2007 was detected. Will be uninstalled.' -Source $deployAppScriptFriendlyName
                Execute-Process -Path 'cscript.exe' -Parameters "`"$scriptDirectory\Files\Office365ProPlus\SupportFiles\OffScrub07.vbs`" ClientAll /S /Q /NoCancel" -WindowStyle Hidden -IgnoreExitCodes '1,2,3'
                Break
            }
        }
        ForEach ($officeExecutable in $officeExecutables) {
            If (Test-Path -Path (Join-Path -Path $dirOffice -ChildPath "Office14\$officeExecutable") -PathType Leaf) {
                Write-Log -Message 'Microsoft Office 2010 was detected. Will be uninstalled.' -Source $deployAppScriptFriendlyName
                Execute-Process -Path "cscript.exe" -Parameters "`"$scriptDirectory\Files\Office365ProPlus\SupportFiles\OffScrub10.vbs`" ClientAll /S /Q /NoCancel" -WindowStyle Hidden -IgnoreExitCodes '1,2,3'
                Break
            }
        }
        ForEach ($officeExecutable in $officeExecutables) {
            If (Test-Path -Path (Join-Path -Path $dirOffice -ChildPath "Office15\$officeExecutable") -PathType Leaf) {
                Write-Log -Message 'Microsoft Office 2013 was detected. Will be uninstalled.' -Source $deployAppScriptFriendlyName
                Execute-Process -Path "cscript.exe" -Parameters "`"$scriptDirectory\Files\Office365ProPlus\SupportFiles\OffScrub13.vbs`" ClientAll /S /Q /NoCancel" -WindowStyle Hidden -IgnoreExitCodes '1,2,3'
                Break
            }
        }

$kma=Get-WmiObject -Class Win32_Product -Filter "Name LIKE 'Microsoft Guide to the Ribbon'"
if ($kma -ne $null) {
Remove-MSIApplications "Microsoft Guide to the Ribbon"
Write-Host "a"
}

$kmb=Get-WmiObject -Class Win32_Product -Filter "Name LIKE 'Microsoft Office 2007 Help Tab'"
if ($kmb -ne $null) {
Remove-MSIApplications "Microsoft Office 2007 Help Tab"
}

$kmc=Get-WmiObject -Class Win32_Product -Filter "Name LIKE 'Microsoft Conferencing Add-in for Microsoft Office Outlook'"
if ($kmc -ne $null) {
Remove-MSIApplications "Microsoft Conferencing Add-in for Microsoft Office Outlook"
}

$kmd=Get-WmiObject -Class Win32_Product -Filter "Name LIKE 'Microsoft Office Live Meeting 2007'"
if ($kmd -ne $null) {
Remove-MSIApplications "Microsoft Office Live Meeting 2007"
}

$kme=Get-WmiObject -Class Win32_Product -Filter "Name LIKE 'Microsoft Office 2010 Interactive Guide'"
if ($kme -ne $null) {
Remove-MSIApplications "Microsoft Office 2010 Interactive Guide"
}
$kmf=Get-WmiObject -Class Win32_Product -Filter "Name LIKE 'Office 2010 User Resources'"
if ($kmf -ne $null) {
Remove-MSIApplications "Office 2010 User Resources"
}
$kmg=Get-WmiObject -Class Win32_Product -Filter "Name LIKE 'Microsoft Office Communicator 2007'"
if ($kmg -ne $null) {
Remove-MSIApplications "Microsoft Office Communicator 2007"
}

*===============================================

* INSTALLATION

$installPhase = "Installation"

*===============================================

Installing Office 365 Pro Plus

Show-InstallationProgress "Instaluję Office 365 Pro Plus. Może to troszkę potrwać. Proszę czekać..."
Execute-Process -FilePath "$dirFiles\Office365ProPlus\setup.exe" -Arguments " /configure "$dirFiles\Office365ProPlus\Installation.xml"" -WindowStyle Hidden -IgnoreExitCodes "3010"

*===============================================

* POST-INSTALLATION

$installPhase = "Post-Installation"

*===============================================

Prompt for a restart (if running as a user, not installing components and not running on a server)

If (($deployMode -eq "Interactive") -and ($IsServerOS -eq $false)) {
Show-InstallationRestartPrompt -Countdownseconds 14400 -CountdownNoHideSeconds 300
}

Show-InstallationProgress "Zainstalowano. Dziękujemy."

*===============================================

* UNINSTALLATION

} ElseIf ($deploymentType -eq "uninstall") { $installPhase = "Uninstallation"

*===============================================

Show Welcome Message, close applications if required with a 60 second countdown before automatically closing

Show-InstallationWelcome -CloseApps "excel,groove,onenote,infopath,onenote,outlook,mspub,powerpnt,winword,winproj,visio,communicator,lync"

Show Progress Message (with the default message)

Show-InstallationProgress "Removing Office 365 Pro Plus with Proofing Tools"
Execute-Process -FilePath "$dirFiles\Office365ProPlus\setup.exe" -Arguments " /configure "$dirFiles\Office365ProPlus\Remove.xml"" -WindowStyle Hidden -IgnoreExitCodes "3010"
......................................
Apr 20, 2015 at 11:51 PM
If you need my zip solution that should be work for you, not a problem, just mail me.
Developer
Apr 30, 2015 at 7:36 AM
Please use the new site for future discussions: http://psappdeploytoolkit.com/