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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript- Sending a keyboard command?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am using VBScript to enhance the functions of an industrial control interface which utilises SL-GMS to implement graphical models (ABB Elsag-Bailey Conductor)<br>It is a totally mouse-driven system except for the frequent need to use the F10 key. I wish to simulate the pressing of that button within a VBScript call.<br>Thanks in advance...
 
Use SendKeys.<br>Here's an example from MSDN:<br><br>Dim WshSHell<br>set WshShell = CreateObject(&quot;WScript.Shell&quot;)<br>WshShell.Run(&quot;calc&quot;)<br>WScript.Sleep(100)<br>WshShell.AppActivate(&quot;Calculator&quot;)<br>WScript.Sleep(100)<br>WshShell.SendKeys(&quot;1{+}&quot;)<br>WScript.Sleep(500)<br>WshShell.SendKeys(&quot;2&quot;)<br>WScript.Sleep(500)<br>WshShell.SendKeys(&quot;~&quot;)<br>WScript.Sleep(500)<br>WshShell.SendKeys(&quot;*3&quot;)<br>WScript.Sleep(500)<br>WshShell.SendKeys(&quot;~&quot;)<br>WScript.Sleep(2500) <p>nick bulka<br><a href=mailto: > </a><br><a href= </a><br>Get your technical books at Bulka's Books<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top