I'm using Visual FoxPro v7 and Windows script host shell in Windows NT 4.0 to open a DOS window, run a DOS based executable program, and then provide the user the ability to cancel the program and return to the FoxPro application. This is all being done from a FoxPro program. The DOS program can be canceled by issueing a control-C to the the DOS window. The problem I am having is that while the program is running in the DOS window and a control-c is sent by the script host, nothing happens. The program keeps running and I have to manually stop the program by hitting ctrl-c from the keyboard.
Here is the code I am running from my FoxPro program to do all this:
DECLARE Sleep IN Win32API;
integer dwDelay
oShell = CREATEOBJECT("WScript.Shell"
oShell.run("cmd /k cd d:\projects & iscst3.exe", 3)
IF oShell.AppActivate("C:\WINNT"
= Sleep(100)
oShell.SendKeys("^c"
oShell.SendKeys("EXIT~"
ENDIF
As I noted before, the ^c in the SendKeys method is not stopping the iscst3 program in the DOS window. Any help is appreciated.
Thanks.
Here is the code I am running from my FoxPro program to do all this:
DECLARE Sleep IN Win32API;
integer dwDelay
oShell = CREATEOBJECT("WScript.Shell"
oShell.run("cmd /k cd d:\projects & iscst3.exe", 3)
IF oShell.AppActivate("C:\WINNT"
= Sleep(100)
oShell.SendKeys("^c"
oShell.SendKeys("EXIT~"
ENDIF
As I noted before, the ^c in the SendKeys method is not stopping the iscst3 program in the DOS window. Any help is appreciated.
Thanks.