Skip to content

Instantly share code, notes, and snippets.

@ServiceDeskCSI
Created December 18, 2024 14:54
Show Gist options
  • Save ServiceDeskCSI/71d4386f3e6b7812493f1d4cd276f775 to your computer and use it in GitHub Desktop.
Save ServiceDeskCSI/71d4386f3e6b7812493f1d4cd276f775 to your computer and use it in GitHub Desktop.
# Define Adobe Acrobat process name and install path
$acrobatProcess = "Acrobat.exe"
$installPath = "C:\Program Files\Adobe\Acrobat DC\Acrobat"
# Close Adobe Acrobat if it's running
$acrobat = Get-Process -Name $acrobatProcess -ErrorAction SilentlyContinue
if ($acrobat) {
Write-Host "Closing Adobe Acrobat..."
Stop-Process -Name $acrobatProcess -Force
Start-Sleep -Seconds 3
}
# Use Get-WmiObject to find the product code for Adobe Acrobat (64-bit)
$acrobatProduct = Get-WmiObject -Class Win32_Product | Where-Object {
$_.Name -like "Adobe Acrobat*"
}
if ($acrobatProduct) {
# Get the product code from the WMI object
$productCode = $acrobatProduct.IdentifyingNumber
Write-Host "Repairing Adobe Acrobat using product code: $productCode"
# Run msiexec to repair the Adobe Acrobat installation
Start-Process "msiexec.exe" -ArgumentList "/fa $productCode /quiet" -Wait
Write-Host "Repair process complete."
} else {
Write-Host "Unable to find Adobe Acrobat (64-bit) installation."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment