Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I use Send Keys with the space bar?

Status
Not open for further replies.

McEnaney

Technical User
May 1, 2002
1
US
Hi. I'm new to VBScript, and I'm using VBScript Send Keys
to install a number of products. I'm running into trouble when I need to check a number of boxes for different options. In the product, I highlight the option and hit the space bar, but this does not seem to work when executing the script. I have tried {SPACE} and {""}.

Any help would be wonderful.
Thanks.
 
helo

don't try {""}, instead use {" "}
hope it will work.

ComputerJin.
 
I presume you are referring to the Sendkeys method of WSH. The braces aren't necessary.

Set oWSH = CreateObject("WScript.Shell")
oWSH.SendKeys " " ' press spacebar

If the check boxes have hotkeys, you can use those:

Set oWSH = CreateObject("WScript.Shell")
oWSH.SendKeys "%H" ' press ALT+H Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top