-
July 2nd, 2014, 07:30 AM
#1
VBScript(SendKeys)
I am trying to create a VBS to send keystrokes to an application and basically autofill a registration form so i dont have to do it literally, about 500 times.... once per computer. This is the scripts I have completed so far...
It brings the proper window to the front, and then does nothing. If I were to press any key on the keyboard, it begins typing in the selected field. If i reference it to bring up an open notepad, it type accordingly there. I am not the greatest at VBscript and mostly just pull things from various sources and try to make them work together.
Code:
Set WshShell = WScript.CreateObject("WScript.Shell")
'WshShell.Run "VSPACE"
WshShell.AppActivate "License Wizard"
WScript.Sleep 500
' name
WshShell.Sendkeys "RPS"
WshShell.Sendkeys "{TAB}"
'Company
WshShell.Sendkeys "ROCKLAND PUBLIC SCHOOLS"
WshShell.Sendkeys "{TAB}"
'Country
WshShell.Sendkeys "{TAB}"
'Address
WshShell.Sendkeys "52 MACKINLAY WAY"
WshShell.Sendkeys "{TAB}"
'City
WshShell.Sendkeys "ROCKLAND"
WshShell.Sendkeys "{TAB}"
'State
WshShell.Sendkeys "MA"
WshShell.Sendkeys "{TAB}"
'zip
WshShell.Sendkeys "02370"
WshShell.Sendkeys "{TAB}"
'email
WshShell.Sendkeys "TECHNOLOGY@ROCKLANDSCHOOLS.ORG"
WshShell.Sendkeys "{TAB}"
'phone
WshShell.Sendkeys "7818718415"
WshShell.Sendkeys "{TAB}"
'reseller
WshShell.Sendkeys "OCKERS"
WshShell.Sendkeys "{TAB}"
'type
WshShell.Sendkeys "{TAB}"
'next
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys "{ENTER}"
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys "{ENTER}"
WshShell.Sendkeys "{ENTER}"
WshShell.Sendkeys "{ENTER}"
WshShell.Sendkeys "{ENTER}"
-
July 2nd, 2014, 11:25 AM
#2
Re: VBScript(SendKeys)
You didn't say what KIND of form, and who calls it up and how?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|