Results 1 to 8 of 8

Thread: OS_ShellExecute a sequence of programs (a daisy-chain)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Jan 2009
    Location
    UK
    Posts
    15
    Rep Power
    17

    OS_ShellExecute a sequence of programs (a daisy-chain)

    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
    Last edited by JohnP; 19-06-2011 at 00:30.

Similar Threads

  1. Daisy World and the Gaia Hypothesis
    By Charles Pegge in forum Shout Box Area
    Replies: 4
    Last Post: 29-11-2010, 02:22
  2. using os_shellexecute
    By sandyrepope in forum OS
    Replies: 2
    Last Post: 26-11-2007, 10:43
  3. Capturing OS_ShellExecute Output?
    By mhillmer in forum Console
    Replies: 4
    Last Post: 13-09-2007, 17:34

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •