# Define the path to the Office Click-to-Run executable
$officeC2RPath = "C:\Program Files\Common Files\Microsoft Shared\ClickToRun\OfficeC2RClient.exe"
# Test if the file exists
if (Test-Path $officeC2RPath) {
# Run update if the file exists
& $officeC2RPath /update user displaylevel=true forceappshutdown=true
Write-host -ForegroundColor Yellow "The Office Click-to-Run executable exists at the specified path and is running."
}
else {
# Cancel the operation if the file doesn't exist
Write-host -ForegroundColor Red "The Office Click-to-Run executable doesn't exist at the specified path so update skipped"
}
Script data
Language - Bat
Run as - System / Root User
Script timeout duration - 120 Mins