Avatar of bbimis
bbimis

asked on 

script to find any version of adobe other than a specific version

i need to take and query a list of computers using psexec or powershell to do the following.
1) find if version of adobe is greater than 9.40
2) if version is greater then silently uninstall program
3) install version 9.4 silently

$SoftwareKey = "HKLM:\Software" 
if ((Get-WmiObject Win32_OperatingSystem).OSArchitecture -match "64-bit") { $SoftwareKey = "HKLM:\Software\WOW6432Node" } 

if (Test-Path "$SoftwareKey\adobe\Acrobat Reader") { 
$adobeversion = get-childitem "$SoftwareKey\adobe\Acrobat Reader" 
foreach ($version in $adobeversion) { 
Write-Output "Found verstion $($version.PSChildName) of Adobe Reader" 
} 

if ($version.PSCHILDNAME > 9.4) {
 #then uninstall the software
 # and install new software via uploaded exe
   
}

Open in new window


i think maybe generating a list first of who has it and and then maybe running a uninstall install against that list?  Help please?

here a batch script i came up with but obviously i can't get it to work.
@echo off
setlocal
set CheckVersion=9.4.0
echo Checking Flash against version %CheckVersion% ...
for /f "tokens=3" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\adobe\Acrobat Reader" /v Version 2^>NUL ^| find /i "Version"') do set DisplayVersion=%%a
echo Adobe Reader version: %DisplayVersion%; 
if "%DisplayVersion%"=="%CheckVersion%" (
  echo ... location has correct version ...
  goto :eof
)

echo Please wait while installing the new version ...
start "" /wait "c:\tempdir\adobeinstall.exe" /sAll
echo Done.

Open in new window

PowershellWindows BatchVB Script

Avatar of undefined
Last Comment
bbimis
ASKER CERTIFIED SOLUTION
Avatar of NVIT
NVIT
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of bbimis
bbimis

ASKER

thank you so much!!!
VB Script
VB Script

VBScript (Visual Basic Scripting Edition) is an interpreted scripting language developed by Microsoft that is modeled on Visual Basic, but with some important differences. VBScript is commonly used for automating administrative and other tasks in Windows operating systems (by means of the Windows Script Host) and for server-side scripting in ASP web applications. It is also used for client-side scripting in Internet Explorer, specifically in intranet web applications.

39K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo