>>Can you use sendkeys to close a DOS window that was started using:
>>
>>oShell = CREATEOBJECT('WScript.Shell')
>>oShell.Run('postal "customer"')
>>
>>The DOS window is asking for Ctrl+C to close the window. I was trying this instead of the run postal "customer" so that I can close the window programatically.
>>
>>Per the MSDN I tried
>>
>>oshell.SendKeys "^c"
>>
>>and
>>
>>oshell.SendKeys "%{F4}"
>>
>>I'm getting a syntax error.
>>
>>Regards,
>>
>Steve
>
>Is the code you're executing within Fox and as shown above? If so, you need parameters to pass the key codes.
What's the syntax for that? I also tried this from the MSDN with no success:
From MSDN: The parameter passed AppActivate is the caption of the recipient program's main window.
oShell.AppActivate("postal") && This is the caption of the DOS window.
I get unknown name error code.
From MSDN: The SendKeys syntax is
WshShell.SendKeys (bstrKeys As String, [pvarWait])
Tried this, too.
oSHell.sendkeys("^C")
oSHell.sendkeys("^C",.f.)
Steve McMahon
ZDI
San Diego