Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Catching stderr from VB when using Shell

Posted on 1999-06-23
3
Medium Priority
?
320 Views
Last Modified: 2010-05-18
How do I catch stderr when I am using VB's Shell command? At present I am calling a batch file and redirecting the stdout (standard output) to a text file. Unfortunately this does not catch the stderr (standard error) messages which I also need. Thanks in advance.
0
Comment
Question by:Kitsune
[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
3 Comments
 

Expert Comment

by:NiTech
ID: 1519366
aha=shell("c:\xyz.bat")

 ' aha will return that c:\xyz.bat does not exist... ?

Is that what you want?
Nit-
0
 
LVL 7

Accepted Solution

by:
simonsabin earned 200 total points
ID: 1519367
Have a look at
http://hinf.uvic.ca/hiscours/h171/cw/lab/s6/session.htm
for help on dos redirection
if you do

shell ("program 2>c:\err.log")
and then check err.log you will find the stderr output
0
 
LVL 1

Author Comment

by:Kitsune
ID: 1519368
Yes, although I was using the redirection character '>' I was unaware that I could specify the stream value directly prior to it. As a result only stream 1 was being passed to the file when I really required both stream 1 & 2. Also the append option was useful.

Thanks.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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 …
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…
Suggested Courses

670 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