VB Script send key example used in a script that opens a webpage in chrome (if installed) selects all, copies to clipboard and then closes
' Example to open chrome to a website select all and copy to clipboard and then close using send keys
Dim iURL
Dim objShell
iURL = "https://csforu.com"
Set WshShell = WScript.CreateObject("WScript.Shell")
set objShell = CreateObject("Shell.Application")
'
' Open URL
objShell.ShellExecute "chrome.exe", iURL, "", "", 1
'
' Send tab to get out of address area of Chrome
WScript.Sleep 6000
WshShell.SendKeys "{TAB}"
WScript.Sleep 300
'
' Send Ctrl A to select all
WshShell.SendKeys "^a"
WScript.Sleep 300
'
' Send Ctrl C to copy to clipboard
WshShell.SendKeys "^c"
WScript.Sleep 100
'
' Send Ctrl F4 to close tab
WshShell.SendKeys "^{F4}"VB Script example
