1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

How do you know when a process is finished? [when running batch file]

Discussion in 'Windows XP' started by Mackerel, 2008/12/11.

  1. 2008/12/11
    Mackerel

    Mackerel Inactive Thread Starter

    Joined:
    2008/11/14
    Messages:
    1
    Likes Received:
    0
    I've got an item which needs to be deleted and then a script runs to create a new copy of information. I've set the sequencing up in a batch file, but the second process doesn't run because the first hasn't finished.

    Any ideas how to do wait to get this sequenced? I could also wait in VBA. I get "Task id" in VBA, but I don't know how to "watch" it to know it's finished.

    Makerel
     
    Last edited: 2008/12/11
  2. 2008/12/11
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    In a batch file the next action will start when the previous one completes, e.g. the next line with the command. For example, I use these 2 commands to delete the user's temp dir and then recreate it after it has been deleted:
    Code:
    RD /S/q   "%UserProfile%\Local Settings\Temp\" 
    MD  "%UserProfile%\Local Settings\Temp\ "
    It won't Make Directory until after Remove Directory.

    If your code does not do what it should then there's a reason the previous command (process) does not complete, and you need to figure out what causes it to hang, i.e. incorrect syntax, file permissions, security policies, etc.

    Post your code here.
     

  3. to hide this advert.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.