Click to See Complete Forum and Search --> : How to run a DOS application in VB application without display the Window's DOS shell window?


xiaohm
August 25th, 1999, 04:28 AM
Hi,

I want to run a DOS application from my VB application.

My question is how to run a DOS application in VB application without display DOS prompt window.

Lothar Haensler
August 25th, 1999, 04:58 AM
this works under NT 4

Shell "cmd.exe /C dir",vbhide
(in win95 you should use command instead of cmd

xiaohm
August 25th, 1999, 05:47 AM
Thank u very much.

One more question, my application will lose focus (VBHide) and doesn't wait for the dos application end.

May be I can use AppActivate to get focus again, I am not sure.

How to detect if the started dos application is ended?

Lothar Haensler
August 25th, 1999, 06:26 AM
if you need to wait for the end of the started app, I suggest you use the CreateProcess API and WaitForSingleObject.