About executing DOS programs in a VB program... 
Author Message
 About executing DOS programs in a VB program...

Hello!

I need to executed DOS programs in a VB program and I have to get the
standard output of the program if possible...

Thank you...

Bye

Xavi.
---------------------------------------------------------------------------------
                           Xavier Aspas Bayon
   Estudiant de 2on-3er d'Enginyeria Tecnica en Informatica de Gestio.
       Vocal d'AEIGI (Associacio Estudiants Informatica de Girona)
                    Hades World Wide Web manager.

                    WWW: http://www.*-*-*.com/ ~xavi/
-------------------------------------------------------------------------------



Mon, 12 Oct 1998 03:00:00 GMT  
 About executing DOS programs in a VB program...



Quote:
>Hello!
>I need to executed DOS programs in a VB program and I have to get the
>standard output of the program if possible...

I'm doing that using Shell("voltd.exe >voltd.out", 1) right now (I
think the quotes are required because of the redirect).  There is a
problem knowing when the program is done running.  I hear Microsoft
has a solution on their web site, but I haven't had time to look it up
-- I'm just using a delay loop.  

It works fine on Windows NT, but when I tried it on another machine
running Win3.1 it just bombed out to DOS, no warning or error message.
Anybody have any ideas on this?
-------------------------------------------------
Allen Windhorn
P.O. Box 265
Kasota, MN  56050



Tue, 13 Oct 1998 03:00:00 GMT  
 About executing DOS programs in a VB program...


typed:

Quote:
>I need to executed DOS programs in a VB program and I have to get the
>standard output of the program if possible...

x% = Shell("c:\command.com /c dosapp.exe >yourfile.txt")

wait_for_app_to_finish_code_here

now read yourfile.txt


--
VB 3.0 and Win31x assumed

http://www.sn.no/~balchen/
ftp://ftp.sn.no/user/balchen/



Tue, 13 Oct 1998 03:00:00 GMT  
 About executing DOS programs in a VB program...


Quote:
>There is a
>problem knowing when the program is done running.  I hear Microsoft
>has a solution on their web site, but I haven't had time to look it up
>-- I'm just using a delay loop.  

Declare Function GetModuleUsage Lib "Kernel" (ByVal hModule As Integer) As
        Integer

x% = Shell(.....)

do while getmoduleusage(x%) <> 0
        Doevents
loop


--
VB 3.0 and Win31x assumed

http://www.sn.no/~balchen/
ftp://ftp.sn.no/user/balchen/



Wed, 14 Oct 1998 03:00:00 GMT  
 About executing DOS programs in a VB program...



Quote:
>I need to executed DOS programs in a VB program and I have to get the
>standard output of the program if possible...

Well, use the SHELL command, and then get a application called
SpyWorks.  This  may help with your dilema.  You can then monitor all
the Window Msgs coming from class id "OLDMSAPP"  I think it is called,
the DOS prompt that is.. or anytime PIF is used.

(I like Win95 DOS Prompt, it tells you current program running in the
Window)

Later.....
-----------------------------------------------------
  "there is no such thing as a bug, its a feature!"
         :) Budman



Thu, 15 Oct 1998 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Execute DOS program from VB program

2. Execute DOS program from VB program

3. execute a dos program from VB

4. HELP!. Communication between DOS programs and VB programs

5. connecting dos program to vb program

6. How can I use a Dos program within a VB program

7. Making a Qbasic program execute a DOS command

8. execute a dos program

9. Shell to execute DOS program

10. Executing external DOS program

11. executing dos commands or programs

12. Executing DOS programs

 

 
Powered by phpBB® Forum Software