Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Need help with appropriate command for wsh

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,61738
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Need help with appropriate command for wsh
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Need help with appropriate command for wsh - 6/23/2008 3:53:01 AM   
  texasintro

 

Posts: 2
Score: 0
Joined: 6/22/2008
Status: offline
Let me try this again, apparently I explained it badly.

Here is a little wsh script which works by inserting tabs when I hit cntrl-alt-a (which Ive defined in the shortcut of the wsh file using the properties tab).  I use the control sequence inside of the currently executing pgm, such as notepad.

Dim WshShell
Set WshShell = Wscript.CreateObject("Wscript.shell")
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys "{TAB}"

However, what I really want to do is send AUSTIN {TAB} TX {TAB} 787
But when I add the line  WshShell.Sendkeys "AUSTIN" it does nothing, though I get no runtime error
When I add the line WshShell.Echo "AUSTIN"  (which I didnt think would work anyway)  I get a runtime error.

Is there some command that will successfully send text?  Thanks!

I can get text into those pop up boxes using Echo, but that isnt of much help.
 
 
Post #: 1
 
 RE: Need help with appropriate command for wsh - 6/23/2008 6:00:43 AM   
  Stumpedtechy

 

Posts: 41
Score: 0
Joined: 11/30/2007
Status: offline
Hrmmmm not sure why it does not work. What are you sending the keys to?

I did this and it worked just as you said.

send AUSTIN {TAB} TX {TAB} 787

Dim WshShell
Set WshShell = Wscript.CreateObject("Wscript.shell") 
WshShell.Sendkeys "AUSTIN"
WshShell.Sendkeys " "
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys " "
WshShell.Sendkeys "TX"
WshShell.Sendkeys "{TAB}"
WshShell.Sendkeys " "
WshShell.Sendkeys "787"

output is - AUSTIN   TX  787

(in reply to texasintro)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Need help with appropriate command for wsh Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts