Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9006909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:32:18+00:00 2026-06-16T01:32:18+00:00

Can the below programming structure is possible in VBScript.Where ProgA will start and after

  • 0

Can the below programming structure is possible in VBScript.Where ProgA will start and after some lines of execution,it will give birth two procsses say ProgB and ProgC.When these child .vbs will be done,then Parent program ProgA will resume its execution and will finish its taks

                                    ProgA.VBS
                                        |
                 -------------------------------------------------
                 |                                               |
            ProgB.VBS                                        ProgC.VBS

thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:32:20+00:00Added an answer on June 16, 2026 at 1:32 am

    Read about then .Run and .Exec methods of the WshShell object (CreateObject("Wscript.Shell")). Make sure you pay attention to the bWaitOnReturn parameter to .Run and the .Status (and .Exitcode) properties of the WshScriptExec object. This answer contains sample code for .Run and .Exec.

    Update:

    a.vbs (not production quality code!):

    Option Explicit
    
    Const WshFinished = 1
    
    Dim goWSH : Set goWSH = CreateObject("WScript.Shell")
    
    Dim sCmd, nRet, oExec
    
    sCmd = "cscript .\b.vbs"
    WScript.Echo "will .Run", sCmd
    nRet = goWSH.Run(sCmd, , True)
    WScript.Echo sCmd, "returned", nRet
    
    sCmd = "cscript .\c.vbs"
    WScript.Echo "will .Exec", sCmd
    Set oExec = goWSH.Exec(sCmd)
    Do Until oExec.Status = WshFinished : WScript.Sleep 100 : Loop
    WScript.Echo sCmd, "returned", oExec.ExitCode
    
    WScript.Echo "done with both scripts"
    WScript.Quit 0
    

    .Runs b.vbs:

    MsgBox(WScript.ScriptName)
    WScript.Quit 22
    

    and .Execs c.vbs:

    MsgBox(WScript.ScriptName)
    WScript.Quit 33
    

    output:

    cscript a.vbs
    will .Run cscript .\b.vbs
    cscript .\b.vbs returned 22
    will .Exec cscript .\c.vbs
    cscript .\c.vbs returned 33
    done with both scripts
    

    The MsgBoxes will prove that a.vbs waits for b.vbs and c.vbs.

    Update II – VBScript’s MultiProcessing ((c) @DanielCook):

    ax.vbs:

    Option Explicit
    
    Const WshFinished = 1
    
    Dim goWSH : Set goWSH = CreateObject("WScript.Shell")
    
    ' Each cmd holds the command line and (a slot for) the WshScriptExec
    Dim aCmds : aCmds = Array( _
        Array("cscript .\bx.vbs", Empty) _
      , Array("cscript .\cx.vbs", Empty) _
    )
    Dim nCmd, aCmd
    For nCmd = 0 To UBound(aCmds)
        ' put the WshScriptExec into the (sub) array
        Set aCmds(nCmd)(1) = goWSH.Exec(aCmds(nCmd)(0))
    Next
    Dim bAgain
    Do
        WScript.Sleep 100
        bAgain = False ' assume done (not again!)
        For Each aCmd In aCmds
            ' running process will Or True into bAgain
            bAgain = bAgain Or (aCmd(1).Status <> WshFinished)
        Next
    Loop While bAgain
    For Each aCmd In aCmds
        WScript.Echo aCmd(0), "returned", aCmd(1).ExitCode
    Next
    
    WScript.Echo "done with both scripts"
    WScript.Quit 0
    

    .Execs bx.vbs

    Do
      If vbYes = MsgBox("Tired of this rigmarole?", vbYesNo, WScript.ScriptName) Then Exit Do
      WScript.Sleep 300
    Loop
    WScript.Quit 22
    

    and cx.vbs:

    Do
      If vbYes = MsgBox("Tired of this rigmarole?", vbYesNo, WScript.ScriptName) Then Exit Do
      WScript.Sleep 500
    Loop
    WScript.Quit 33
    

    Don’t do this at work without a lot of further effort invested in error handling.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The question below is not really a programming question, but more of how can
Strange programming problems as of now..As you can see below i have assigned intFrontPtr
Can anyone tell me what is wrong with this query below? from a programming
Below are lines from the c++ programming language template<class T > T sqrt(T );
I am new to iphone programming.Can any body tell me that below code is
I found some posts below,but that can not work for my case. How to
As you can see below, I have Parallel.For loop. If run the program while
From the disassembly code below can I assume that the location 43E010 is a
The simple code block below can be served up in a static HTML page
In android the Toggle buttons are looks like below - Can we modify this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.