Solved

Text to a command window

Posted on 2000-04-18
4
144 Views
Last Modified: 2010-05-02
I want to write a command line app in VB.  Basically you call the app with parameters from a dos window.  The problem I have is reporting errors directly back to the dos window.
How can I do this with VB?
0
Comment
Question by:rokslide
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 1

Expert Comment

by:Ask_ED
ID: 2729518
Hi

I believe you are describing what is called a console program.

For a working example try:
Writing Console-Mode Applications in Visual Basic

http://www.vb-world.net/api/console/index3.html

Hope this helps
ED
0
 
LVL 1

Accepted Solution

by:
Ask_ED earned 100 total points
ID: 2729522
Hi Again,

If the console app is "more" than you were looking for ..

To return a DOS error code try the ExitProcess API that can be trapping in a btach file.

For an example try:
http://www.vb2themax.com/Item.asp?PageID=TipBank&ID=50 

VB2theMAX also has other great tips...

Hope this helps
ED

0
 
LVL 43

Expert Comment

by:TimCottee
ID: 2734157
rokslide:

Ask_Ed's link is worthwile looking into, also you could look at:

Sample console app:

http://www.saurik.com/ Goto Samples, smpConsole

All the examples given so far don't address the key problem which is how to actually get the application to run in the command window in which it was started. The link

PAQ: http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=10324610 

shows how it is possible to create a console application such as the smpConsole one from Saurik which will actually run in the original command window.

0
 

Author Comment

by:rokslide
ID: 2753380
Okie, the examples there don't actually do what I was wanting but, delving under he covers abit into some of the background info and follow up questions does so I'm happy. :)  Now all I have to do is find the time to actually understand it all. ;)

Thanks. :)
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

742 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