Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - hta must start cmd, wait, start another cmd

Reply
 
Old 07-01-2009   #1 (permalink)
Dramklukkel


 
 

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
Old 07-01-2009   #2 (permalink)
Mark D. MacLachlan


 
 

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

Dramklukkel wrote:
Quote:

> 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
Old 07-02-2009   #3 (permalink)
Dramklukkel


 
 

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:
Quote:

> Dramklukkel wrote:
>
Quote:

> > 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
Old 07-02-2009   #4 (permalink)
HAL07


 
 

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

Dramklukkel wrote:
Quote:

> 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
Reply

Thread Tools


Similar Threads
Thread Forum
WLAN AutoConfig won't start | Windows Wireless Service won't start.... Network & Sharing
Getting problem to start outlook box for windowlive.com account what to do to start? Vista mail
VIsta The following boot-start or system-start driver(s) failed to load: Drivers
Permission needed to start a specific program in the Start Menu Vista installation & setup
Is there an equivalent of the DOS shell "start /wait" in PowerShel PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46