Solved

Text to a command window

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…

831 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