Steve
Steve

Reputation: 75

Running a vbs script to enable or disable a chrome extension

I have created the following script to enable or disable a chrome extension, the script runs perfectly until it tries to use {ENTER} on the enable or disable button. This action works manually on the keyboard and I have tried different sleep times between this command.

The button id is div#button, is there a way to get this working?

Dim shell
Set shell = wscript.CreateObject("Shell.Application")
set x = CreateObject("Wscript.shell")
shell.Open "C:\Users\steve.newton\Desktop\Google Chrome.lnk"
WScript.Sleep 1000  
x.sendkeys("chrome://extensions/")
WScript.Sleep 1000
x.sendkeys"{ENTER}"
WScript.Sleep 800
x.sendkeys"{TAB}"
WScript.Sleep 100
x.sendkeys"{TAB}"
WScript.Sleep 100
x.sendkeys"{TAB}"
WScript.Sleep 100
x.sendkeys"{TAB}"
WScript.Sleep 100
x.sendkeys"{TAB}"
WScript.Sleep 400
x.sendkeys"{ENTER}"

Upvotes: 0

Views: 1944

Answers (1)

Related Questions