0
votes

I can't figure out how to press Control A (HighLight everything) using VBS, what is it?

Set objShell = WScript.CreateObject("WScript.Shell")
Set WshShell = WScript.CreateObject("WScript.Shell")
WScript.Sleep 500
object.SendKeys "^A"

I get this


Windows Script Host

Script: C:\Users\Shane own\Desktop\A.vbs Line: 4 Char: 1 Error: Object required: 'object' Code: 800A01A8 Source: Microsoft VBScript runtime error


OK

Any idea ?

1

1 Answers

0
votes

SendKeys is a method of the WshShell class. You created two WshShell objects (objShell and WshShell). Just use one of those objects to call the SendKeys method.

objShell.SendKeys "^A"