-
Launch DOS app from VB6
How can I launch a DOS application from my VB6 application, and get access
to the DOS application's return code in VB6?
TIA,
Don Goyette
-
Re: Launch DOS app from VB6
I didn't try this out before posting, but I believe this will work:
Shell "C:\DOSAPP.EXE > APPOUTPUT.TXT"
Then read the results of that text document.
Don Goyette <goyette@cts.com> wrote in message
news:394ea3d5$1@news.devx.com...
>
> How can I launch a DOS application from my VB6 application, and get access
> to the DOS application's return code in VB6?
>
> TIA,
>
> Don Goyette
>
-
Re: Launch DOS app from VB6
To T. Bradley Dean
==================
Your Shell statement won't work -- redirection of output (like internal DOS
commands) require the command processor to be specified. On top of that, the
redirection you indicate will take the program's output to the standand
display and send it to the specified file.
To Don Goyette
==================
The only way I can think of to get the return code is to ECHO it out to a
file from a BAT which first runs the program. Then read the file it sent its
output to. If you have need of this value inside your program, you will have
to make it wait for DOS process to finish.
Rick
T. Bradley Dean <Bradley.Dean@InfoDish.com> wrote in message
news:394ea632@news.devx.com...
> I didn't try this out before posting, but I believe this will work:
>
> Shell "C:\DOSAPP.EXE > APPOUTPUT.TXT"
>
> Then read the results of that text document.
>
>
> Don Goyette <goyette@cts.com> wrote in message
> news:394ea3d5$1@news.devx.com...
> >
> > How can I launch a DOS application from my VB6 application, and get
access
> > to the DOS application's return code in VB6?
> >
> > TIA,
> >
> > Don Goyette
> >
>
>
-
Re: Launch DOS app from VB6
Thank you, Rick. I tried the redirection and indeed it did not work, as VB
could not open the file I redirected it to -- the file just did not get created.
So, How does one "ECHO it out to a file from a BAT"? What's ECHO and BAT?
BTW, the return code is simply output by the DOS application to standard
output as a line: "return code: 1" (or 2 or 3, etc.) Using T. Bradley Dean's
suggestion made sense to me as that let me search the redirected output for
that line. The DOS app is not mine and I cannot make any mods to it.
TIA,
Don Goyette
"Rick Rothstein" <fnroth@aosi.com> wrote:
>To T. Bradley Dean
>==================
>Your Shell statement won't work -- redirection of output (like internal
DOS
>commands) require the command processor to be specified. On top of that,
the
>redirection you indicate will take the program's output to the standand
>display and send it to the specified file.
>
>To Don Goyette
>==================
>The only way I can think of to get the return code is to ECHO it out to
a
>file from a BAT which first runs the program. Then read the file it sent
its
>output to. If you have need of this value inside your program, you will
have
>to make it wait for DOS process to finish.
>
>Rick
>
>T. Bradley Dean <Bradley.Dean@InfoDish.com> wrote in message
>news:394ea632@news.devx.com...
>> I didn't try this out before posting, but I believe this will work:
>>
>> Shell "C:\DOSAPP.EXE > APPOUTPUT.TXT"
>>
>> Then read the results of that text document.
>>
>>
>> Don Goyette <goyette@cts.com> wrote in message
>> news:394ea3d5$1@news.devx.com...
>> >
>> > How can I launch a DOS application from my VB6 application, and get
>access
>> > to the DOS application's return code in VB6?
>> >
>> > TIA,
>> >
>> > Don Goyette
>> >
>>
>>
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks