Acrobat Reader DC
$ProgressPreference = "SilentlyContinue" Invoke-WebRequest -Uri https://ardownload2.adobe.com/pub/adobe/reader/win/AcrobatDC/2500120432/AcroRdrDC2500120432_nl_NL.exe -OutFile C:\Users\Public\Downloads\Adobe.exe Start-Process -FilePath "C:\Users\Public\Downloads\Adobe.exe" -ArgumentList "/sAll /rs /msi EULA_ACCEPT=YES /L*v C:\Windows\Logs\AdobeReaderInstall.log" -Wait
Adobe Acrobat Pro:
$ProgressPreference = "SilentlyContinue"
$Link = "https://trials.adobe.com/AdobeProducts/APRO/Acrobat_HelpX/win32/Acrobat_DC_Web_x64_WWMUI.zip"
$Path = "C:\Users\Public\Downloads"
$File = "Acrobat_DC_Web_x64_WWMUI.zip"
$Product = "Adobe Acrobat"
if (Test-Path $Path\$File) {
Remove-Item $Path\$File
}
if (Test-Path $Path\$Product) {
Remove-Item $Path\$Product -recurse
}
Invoke-WebRequest -Uri $Link -OutFile $Path\$File -UseBasicParsing
Expand-Archive $Path\$File $Path
Start-Process -FilePath $Path\$Product\setup.exe -ArgumentList "/sAll /rs /msi EULA_ACCEPT=YES /L*v $Path\$Product\AdobeAcrobatInstall.log" -Wait
Fix Explorer and Outlook Preview Handler error:
# Uninstall all Adobe products
$programName = "*Adobe*"
$installedProducts = Get-WmiObject Win32_Product
$filteredProducts = $installedProducts | Where-Object { $_.Name -like $programName }
if ($filteredProducts.Count -eq 0) {
Write-Host "No products found matching the name $programName."
} else {
foreach ($product in $filteredProducts) {
$identifyingNumber = $product.IdentifyingNumber
Write-Host "Uninstalling $($product.Name) with IdentifyingNumber $identifyingNumber"
Start-Process "msiexec.exe" -ArgumentList "/qn /norestart /X $identifyingNumber" -Wait
}
Write-Host "All products matching the name $programName have been uninstalled."
}
# Wait 5 seconds
Start-Sleep -Seconds 5
# Remove all remaining Adobe folders
Remove-Item -Path "C:\Program Files (x86)\Adobe" -Recurse -Force
Remove-Item -Path "C:\Program Files\Adobe" -Recurse -Force
Remove-Item -Path "C:\ProgramData\Adobe" -Recurse -Force
# Get the path to the Users directory
$usersPath = "C:\Users"
# Get a list of all user profile directories
$userProfiles = Get-ChildItem -Path $usersPath -Directory
foreach ($profile in $userProfiles) {
# Construct the path to the LocalAppData folder for the current user
$localAppDataPath = [System.IO.Path]::Combine($profile.FullName, 'AppData', 'Local', 'Adobe')
# Construct the path to the RoamingAppData folder for the current user
$roamingAppDataPath = [System.IO.Path]::Combine($profile.FullName, 'AppData', 'Roaming', 'Adobe')
# Check if the Adobe folder exists in Local
if (Test-Path -Path $localAppDataPath) {
try {
# Forcefully delete the Adobe folder and its contents in Local
Remove-Item -Path $localAppDataPath -Recurse -Force
Write-Output "Deleted Adobe folder from: $localAppDataPath"
} catch {
Write-Output "Failed to delete Adobe folder from: $localAppDataPath. Error: $_"
}
} else {
Write-Output "Adobe folder not found in: $localAppDataPath"
}
# Check if the Adobe folder exists in Roaming
if (Test-Path -Path $roamingAppDataPath) {
try {
# Forcefully delete the Adobe folder and its contents in Roaming
Remove-Item -Path $roamingAppDataPath -Recurse -Force
Write-Output "Deleted Adobe folder from: $roamingAppDataPath"
} catch {
Write-Output "Failed to delete Adobe folder from: $roamingAppDataPath. Error: $_"
}
} else {
Write-Output "Adobe folder not found in: $roamingAppDataPath"
}
}
# Wait 5 seconds
Start-Sleep -Seconds 5
# Download and install Adobe Reader DC
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest -Uri https://ardownload2.adobe.com/pub/adobe/acrobat/win/AcrobatDC/2400520320/AcroRdrDCx642400520320_nl_NL.exe -OutFile C:\Users\Public\Downloads\Adobe.exe
Start-Process -FilePath "C:\Users\Public\Downloads\Adobe.exe" -ArgumentList "/sAll /rs /msi EULA_ACCEPT=YES /L*v C:\Windows\Logs\AdobeReaderInstall.log" -Wait
reg add "HKCU\Software\Adobe\Acrobat Reader\DC\Privileged" /v bProtectedMode /t REG_DWORD /d 0 /f
# Wait 10 seconds
Start-Sleep -Seconds 10
Start-Process -FilePath "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe"
# Wait 10 seconds
Start-Sleep -Seconds 10
Stop-Process -Name "AcroRd32" -Force
# Wait 10 seconds
Start-Sleep -Seconds 10
# Install latest version of SumatraPDF with preview enabled
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Internet Explorer\Main" -Name "DisableFirstRunCustomize" -Value 2
$ProgressPreference = "SilentlyContinue"
$url = "https://www.sumatrapdfreader.org/download-free-pdf-viewer"
$html = Invoke-WebRequest -Uri $url
$pattern = 'SumatraPDF-(\d+(\.\d+)+)-64-install\.exe'
$matches = $html.AllElements | Where-Object { $_.tagName -eq "a" -and $_.innerText -match $pattern } | ForEach-Object { $_.innerText }
$latestVersion = $matches | Sort-Object -Descending | Select-Object -First 1
$latestVersion -match 'SumatraPDF-(\d+(\.\d+)+)-64-install\.exe'
$SumatraVersion = $matches[1]
$Link = "https://www.sumatrapdfreader.org/dl/rel/$SumatraVersion/$latestVersion"
$Path = "C:\Users\Public\Downloads"
$File = "SumatraPDF-latest-64-install.exe"
Invoke-WebRequest -Uri $Link -OutFile "$Path\$File" -UseBasicParsing
Start-Process -FilePath "$Path\$File" -ArgumentList "-s -all-users -with-preview" -Wait
Remove-Item "C:\Users\Public\Desktop\SumatraPDF.lnk"
Remove-Item "C:\ProgramData\Microsoft\Windows\Start Menu\SumatraPDF.lnk"