Get Chrome version

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

Post Reply
User avatar
Grovkillen
Automation Wizard
Posts: 640
Joined: Fri Aug 10, 2012 2:38 pm
Location: Hudiksvall, Sweden
Contact:

Get Chrome version

Post by Grovkillen » Mon Apr 26, 2021 3:30 pm

You may need to know which Chrome version that is currently installed, especially if you're planning on automate it using the ChromeDriver.exe. Here's a snippet that will fetch that info for your:

Code: Select all

  Let>CHROME_EXE=C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
  Let>RP_WINDOWMODE=0
  RunProgram>cmd /c powershell (Get-Item '%CHROME_EXE%').VersionInfo | clip
  GetClipBoard>RESPONSE,0
  Let>REGEX_PATTERN=\b(?:[0-9]{1,5}\.){3}[0-9]{1,5}\b
  RegEx>REGEX_PATTERN,RESPONSE,0,FOUND_VERSION,FOUND_MATCHES,0,,,
  If>FOUND_MATCHES>0
    Separate>FOUND_VERSION_1,.,VERSION
    Let>CHROME_major=VERSION_1
    Let>CHROME_minor=VERSION_2
    Let>CHROME_build=VERSION_3
    Let>CHROME_revision=VERSION_4
    Let>CHROME_release=FOUND_VERSION_1
  Endif>
Only "problem" with this approach is the use of the clipboard. If you have more than one script using the clipboard you may get some hard to track bugs when they cross path's. Hopefully we can get a RP_STDOUT variable populated with the result. Fingers crossed!
Let>ME=%Script%

Running: 15.0.18
version history

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts