Send keypresses by Launchkey

Posted Friday, 10 August 2007 by Michael Khanin
Digg!

 If you need to send key to the any application, you can use a VBScript, like following example:

set WshShell = WScript.CreateObject("WScript.Shell")
   WshShell.Run "calc"
   WScript.Sleep 100
   WshShell.AppActivate "Calculator"
   WScript.Sleep 100
   WshShell.SendKeys "1{+}"
   WScript.Sleep 500
   WshShell.SendKeys "2"
   WScript.Sleep 500
   WshShell.SendKeys "~"
   WScript.Sleep 500
   WshShell.SendKeys "*3"
   WScript.Sleep 500
   WshShell.SendKeys "~"
   WScript.Sleep 2500

But, if you want to use a batch script, use a LaunchKey. LaunchKey is a freeware command-line utility that runs an application and sends keypresses to it.

The syntax for using LaunchKey is:

Launchkey "KEYS TO SEND" "APPLICATION TO RUN" ["APPLICATION PARAMETERS"]

as in:

Launchkey "Here is some text." Notepad

"You can send all the normal key character keys as well as special keys like ALT, CTRL, F1-F12 etc. More information about how to send key presses is contained in the accompanying Helpfile."

Download LaunchKey.zip

 





Reddit!Del.icio.us!Google!Facebook!Slashdot!Netscape!Technorati!StumbleUpon!Newsvine!Furl!Yahoo!Ma.gnolia!Free social bookmarking plugins and extensions for Joomla! websites! title=
 

Add comment

You have no rights to add a new comment. May be you need to register on the site.