Re: Positioning a DOS Window

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Robin Clay (anonymous_at_discussions.microsoft.com)
Date: 08/12/04


Date: Thu, 12 Aug 2004 00:47:55 -0700


Thank you for the suggestion - but acksherley....
VBA shells out to run a batch file
that takes several minutes to run.

Meanwhile, VBA continues,
and the next thing it does
is to kill the batch file -
but that is still running !

So I have inserted a MsgBox -
but if the user sees this,
she may be temopted to click OK...

So I wanted the DOS window to hide
the MsgBox until the batch file
has finished running.

Then the DOS window closes,
and the user may then click OK
to let VBA continue.

So I actually want the DOS window
to close on completion.

But what I was seeking
was a way to ensure
that the DOS window
covered the MsgBox.

Thanks again.

>-----Original Message-----
> I don't know a way of positioning the DOS window,
> but you could stop it from closing:
>
> Shell Environ("comspec") & _
> " /k c:\runner.bat", vbNormalFocus
>
> /c (instead of /k) will close the window
>
>Robin Clay wrote:
>>
>> Greetings !
>>
>> I currently have this-
>> --------------------------------------------
>> Open "C:\Runner.bat" For Output As #1
>> Print #1, "@ECHO off"
>> Print #1, "Echo Please wait -"
>> Print #1, "Echo This may take some time ...."
>> Print #1, " [ other DOS commands ] ."
>> Close
>>
>> Shell "C:\Runner.bat", vbNormalFocus
>>
>> MsgBox "Please wait " & vbCrLf & _
>> "until the DOS window closes."
>>
>> Kill "C:\Runner.bat"
>> ----------------------------------------------
>>
>> The reason for the MsgBox
>> is to prevent VBA from KILLing the batch file
>> until it has completed running.
>>
>> I would like the DOS window to cover the MsgBox.
>>
>> How can I specify whereabouts on the screen
>> the DOS window will appear?
>>
>> RClay AT haswell DOT com
>
>--
>
>Dave Peterson
>ec35720@msn.com
>.
>



Relevant Pages

  • Re: just starting
    ... Write a batch file that runs the program and then ends with a PAUSE command ... it flashes open the DOS window and closes quickly ... ... the properties tab has Misc, ... the misc tab has an option for "close on exit" ...
    (comp.programming)
  • Re: Digital signing
    ... opens a dos window for output purposes. ... However, you said "build script". ... wrong (I even went as far as coding a dos batch file). ... app and build the install in one go. ...
    (microsoft.public.vb.general.discussion)
  • Re: subst command in a batch file
    ... however when I run this file, the dos window is opened and this line is ... is most likely your system drive letter. ... - It is likely that you called your batch file "subst.bat". ... Changing the name to testxxxxx3.bat doesn't help, the looping problem ...
    (microsoft.public.windowsxp.general)
  • Re: CMD cant find D:
    ... I'm sure I must need to plug in a path idiciator somewhere as even though ... if I try to run a batch file in a DOS window ... so what do I need to fix and how do I fix it? ... So WHAT is *in* the problematic batch file that you are trying to run? ...
    (microsoft.public.windowsxp.general)
  • Re: subst command in a batch file
    ... however when I run this file, the dos window is opened and this line is ... is most likely your system drive letter. ... not available for substitution. ... - It is likely that you called your batch file "subst.bat". ...
    (microsoft.public.windowsxp.general)