VBScript Basics, Part 8 | SendKeys
VBScripting (.vbs) Basic tutorial on how to use sendkeys to send keyboard keys and commands too your computer. Also how to pause a script for a certain number of seconds or milliseconds.
Special keys:
https://social.technet.microsoft.com/wiki/contents/articles/5169.vbscript-sendkeys-method.aspx
Code Example:
______________________________________________________
Option Explicit
Dim auto
Set auto=CreateObject(“wscript.shell”)
auto.run “notepad.exe”
wscript.sleep 2000
auto.sendkeys “Hello there,”
auto.sendkeys “{enter}”
auto.sendkeys “how are you today?”
auto.sendkeys “%fs”
wscript.sleep 500
auto.sendkeys “test.txt”
______________________________________________________
Know the Basics:
——————————————————————————————
CreateObject(“wscript.shell”).sendkeys “”
——————————————————————————————
Set x = CreateObject(“wscript.shell”)
x.sendkeys “”
——————————————————————————————