29 maj 2008

Wykonanie operacji matematycznych w kalkulatorze

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( "*4" )
Wscript.Sleep (500)
WshShell.SendKeys( "=" )
' 1+2 = 3  * 4 = 12