Solved

Text to a command window

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

914 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

17 Experts available now in Live!

Get 1:1 Help Now