' SKDemo.vbs ' Demonstration of sending keystroke to an ' application. Option Explicit ' lcfile should be initialized to ' the file name the application should ' run. lctitle should be initialized to ' the application's title text. Dim oShell, lcfile, lctitle Set oShell = CreateObject("WScript.Shell") ' Run in a normal window oShell.Run lcfile, 5 oShell.AppActivate lctitle ' Wait one second WScript.Sleep 1000 ' Send the key strokes. oShell.SendKeys "This was sent by the script file.~" WScript.Sleep 1000 ' Save the infomation oShell.SendKeys "%S" WScript.Sleep 1000 ' Close the application oShell.SendKeys "%FX" ' Clean up Set oShell = NothingFrom within VFP
oShell = CREATEOBJECT("WScript.Shell") oShell.Run('skdemo.vbs', 0, .T.)That make sense?