Windows Vista Forums

hta must start cmd, wait, start another cmd
  1. #1


    Dramklukkel Guest

    hta must start cmd, wait, start another cmd

    Good day everone,

    I'm writing a HTA that will run several cmd-files. However, certain cmd I
    will not allowed to run at the same time. E.g. n03.cmd must be finished
    before n08.cmd is allowed to be launched.
    How can this be achieved?

    Dramklukkel
    --
    I fixed it right the first time.
    It must have failed for other reasons.



      My System SpecsSystem Spec

  2. #2


    Mark D. MacLachlan Guest

    Re: hta must start cmd, wait, start another cmd

    Dramklukkel wrote:

    > Good day everone,
    >
    > I'm writing a HTA that will run several cmd-files. However, certain
    > cmd I will not allowed to run at the same time. E.g. n03.cmd must be
    > finished before n08.cmd is allowed to be launched.
    > How can this be achieved?
    >
    > Dramklukkel
    Use the WSHShell.Exec method instead or WSHShell.Run. This will let
    you check for process completion.

    http://msdn.microsoft.com/en-us/libr...4a(VS.85).aspx

    Hope that helps.

    Regards,

    Mark D. MacLachlan


    --


      My System SpecsSystem Spec

  3. #3


    Dramklukkel Guest

    Re: hta must start cmd, wait, start another cmd

    Mark,
    thanks for your reply.
    I found the following code:
    '---------
    Dim WshShell, oExec
    Set WshShell = CreateObject("WScript.Shell")
    Set oExec = WshShell.Exec("calc")
    Do While oExec.Status = 0
    WScript.Sleep 100
    Loop
    WScript.Echo oExec.Status
    '---------

    I replaced the "WScript.Echo" with "Msgbox", since HTA does not seem to like
    WScript things.
    However I do not get the "WScript.Sleep 100" to work. WScript thingy again.
    I tried "iTimerID = window.setInterval("RunScript", 5000, "VBScript")" to no
    avail.
    Any hints?


    Dramklukkel


    "Mark D. MacLachlan" wrote:

    > Dramklukkel wrote:
    >

    > > Good day everone,
    > >
    > > I'm writing a HTA that will run several cmd-files. However, certain
    > > cmd I will not allowed to run at the same time. E.g. n03.cmd must be
    > > finished before n08.cmd is allowed to be launched.
    > > How can this be achieved?
    > >
    > > Dramklukkel
    >
    > Use the WSHShell.Exec method instead or WSHShell.Run. This will let
    > you check for process completion.
    >
    > http://msdn.microsoft.com/en-us/libr...4a(VS.85).aspx
    >
    > Hope that helps.
    >
    > Regards,
    >
    > Mark D. MacLachlan
    >
    >
    > --
    >
    >

      My System SpecsSystem Spec

  4. #4


    HAL07 Guest

    Re: hta must start cmd, wait, start another cmd

    Dramklukkel wrote:

    > Mark,
    > thanks for your reply.
    > I found the following code:
    > '---------
    > Dim WshShell, oExec
    > Set WshShell = CreateObject("WScript.Shell")
    > Set oExec = WshShell.Exec("calc")
    > Do While oExec.Status = 0
    > WScript.Sleep 100
    > Loop
    > WScript.Echo oExec.Status
    > '---------
    >
    > I replaced the "WScript.Echo" with "Msgbox", since HTA does not seem to like
    > WScript things.
    > However I do not get the "WScript.Sleep 100" to work. WScript thingy again.
    > I tried "iTimerID = window.setInterval("RunScript", 5000, "VBScript")" to no
    > avail.
    > Any hints?

    This popped up as the first hit on google search: http://www.big-fly.net/oa5599/?p=11


    --
    -- HAL07, Engineering Services, Norway

      My System SpecsSystem Spec

hta must start cmd, wait, start another cmd

Similar Threads
Thread Thread Starter Forum Replies Last Post
The following boot-start or system-start driver(s) failed to load: i8042prt Petze General Discussion 33 21 Nov 2009
WLAN AutoConfig won't start | Windows Wireless Service won't start.... wheatln2 Network & Sharing 5 25 Jul 2009
VIsta The following boot-start or system-start driver(s) failed to load: tjcrazy Drivers 3 12 Jan 2009
Permission needed to start a specific program in the Start Menu Paddy Vista installation & setup 5 12 Aug 2007
Is there an equivalent of the DOS shell "start /wait" in PowerShel Brillig PowerShell 6 20 Jan 2007