Capturing DOS output from VB6

Posted on 2003-10-23
Last Modified: 2008-02-01
Hello all,

I am shelling this line of code from VB6 to compile various .java files into classes:

"C:\jdk1.3.1_02\bin\javac -d D:\Temp\SPACE\java_classes\ -classpath D:\Temp\SPACE\java_classes\;D:\Dev\Java\com\calibre\space\mail.jar;D:\Dev\Java\com\calibre\space\servlet.jar D:\Dev\Java\com\calibre\space\*.java"

This works fine if no problems are encountered in the compile process. But fails if one of the files doesn't compile. No error messages display though to tell the user something has gone wrong. If I run the above command in a DOS window, then I get some error messages that are useful. I was hoping to be able to catch these error messages & relay them back to my VB app so that the user can see what's going on if the command should fail.

I have searched the microsoft website & found some info (, but unfortunately I can't get their example to work!

If any one can offer any suggestions I would be most grateful. Thank you in advance for your help.

Question by:ConfusedMike
LVL 49

Expert Comment

by:Ryan Chong
ID: 9605172

Author Comment

ID: 9605220
Hi Ryancys,

Thanks for your reply. Unfortunately I experienced the same problem that Trowa encountered when trying to get the Microsoft example code to work for the javac command (the app hangs on the ReadFile call).... and it seems that on that thread no solution was found to this problem :(


Expert Comment

ID: 9605687
The Microsoft has a good example for this:

Then read at tips 12

Thanks & Cheers

Author Comment

ID: 9605722
Thanks Fantasy, but I'm not dealing with menu items (unless I've misunderstood!). I have however since found a working example..... I've lost the URL (doh). Is it possible to attach files to a thread, so that I can share it?

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.


Expert Comment

ID: 9605784
Not, just follow the link, and choose the tip12 from the left menu. try again

Author Comment

ID: 9605793
Thanks man. As I say though, I now have a working example which I found elsewhere on the net. I'm going to try & find the link again so I can post it here for folk.

Author Comment

ID: 9605815
Got it. Here it is:

This worked a treat (first time & with the minimum of fuss!).

So I guess this question can now be closed. Thanks for your efforts.


Expert Comment

ID: 9606139
shd i suggest you some other alternative
why don't u put the dos output to a text file and then after the execution of dos command check that txt file(read it)

dos ha redirectional
dir>>a.txt will redirect dir to a.txt file

tell me if u liked that

Accepted Solution

PashaMod earned 0 total points
ID: 11023244
PAQed, with points refunded (250)

Community Support Moderator

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
scoresClump  challenge 31 108
sumHeights  challenge 17 61
creating threads in delphi 1 54
Programatically extract date from website 8 17
Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now