Hi all,
Can anyone help with this problem?
I would like to run an initial program (call it Prog1) which, when it has finished its purpose, runs another program (call it Prog2) and Prog1 stops, whilst Prog2 continues.
Then, when Prog2 has finished its purpose, it runs another program (call it Prog3) and Prog2 stops, whilst Prog3 continues, etc, etc.
I have written three simple test programs to see how this might work, but no matter what I do, I can only get one program to execute another. The next execution attempted (by the second program) fails, without any error.
e.g. Prog1 will run Prog2, but Prog2 won't run Prog3. Also Prog2 will run Prog3, so there appears to be nothing wrong with the code in Prog2.
It's a complete puzzle. Is there a limit of only one operation in the OS_ShellExecute function?
I am running Win7 64-bit.
My code for Prog1 is shown below and is virtually identical in Prog2, etc, except that the titles of the programs being executed are changed to the appropriate ones:
' Test OS_ShellExecute
' Prog 1
Uses "OS", "console"
Dim pID As Long
Cls
PrintL "PROGRAM 1."
PrintL
PrintL "Now about to run Program 2....."
pID = OS_ShellExecute("open","OS_Shell_prog2.tbasic","","",1)
PrintL "pID=",pID
PrintL
If pID>0 Then
PrintL "pID was greater than zero, so Prog 2 should run."
End If
WaitKey
regards
JohnP
Bookmarks