Solved

Text to a command window

Posted on 2000-04-18
4
140 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
  • 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

746 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

10 Experts available now in Live!

Get 1:1 Help Now