Closing Dos Window after Shell command

G

Garry

I have a batchfile in DOS that I need to run from a Wword
Mmacro. I can run the DOS batchfile fine but I can't get
the DOS window to close, even when the last line of the
DOS batchfile is EXIT. When run from a DOS window, the
batchfile executes the EXIT command and closes the DOS
window.

How can I colse the DOS window?

Garry
 
T

Thomas Winter

Garry said:
I have a batchfile in DOS that I need to run from a Wword
Mmacro. I can run the DOS batchfile fine but I can't get
the DOS window to close, even when the last line of the
DOS batchfile is EXIT. When run from a DOS window, the
batchfile executes the EXIT command and closes the DOS
window.

How can I colse the DOS window?

Garry

Windows does that so you can see the "results" of the batch file (even if
you use EXIT). Clear the screen (using CLS) at the end of your batch file,
and then the window should close automatically.

-Tom
 
J

Jonathan West

Hi garry

Go to www.mvps.org/vb/

Click the Samples link on the left, and scroll down tot he Shell32 sample.
There is a module there you can download that includes a routine that will
close a DOS box on completion.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top