473,672 Members | 3,854 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why DOS output of DEL commands to a file won't display error messages?

2 New Member
Hi. Yes DOS still lives.... I am directing multiple delete (DEL) commands to an output file e.g.
del /F /Q D:\Oracle\CoreM id\Apache\Apach e\logs\*.* >vh.txt
del /F /Q D:\Oracle\Core\ Apache\Apache\l ogs\*.* >>vh.txt
del /F /Q D:\Oracle\CoreM id\opmn\logs\*. * >>vh.txt
del /F /Q D:\Oracle\CoreM id\webcache\log s\*.* >>vh.txt
del /F /Q D:\Oracle\CoreI nfra\opmn\logs\ *.* >>vh.txt

I am appending the output in each case except line 1 - that part is ok.
However when there is an error message it doesnt appear in the output file. For example if I run this command (del /F /Q D:\Oracle\CoreM id\opmn\logs\*. *) at Dos prompt I get:
D:\Oracle\CoreM id\opmn\logs\HT TP_Server~1
The process cannot access the file because it is being used by another process.
D:\Oracle\CoreM id\opmn\logs\ip m.log
The process cannot access the file because it is being used by another process.
D:\Oracle\CoreM id\opmn\logs\OC 4J~home~default _island~1
The process cannot access the file because it is being used by another process.

However if I run it with output to file vh.txt i get:
D:\Oracle\CoreM id\opmn\logs\HT TP_Server~1
D:\Oracle\CoreM id\opmn\logs\ip m.log
D:\Oracle\CoreM id\opmn\logs\OC 4J~home~default _island~1

As you can see there are no error message in the output results that are written to file, but they are displayed if output is to screen.
How can I capture the error messages in the output file???
Jan 12 '11 #1
3 6565
Banfa
9,065 Recognized Expert Moderator Expert
The error messages are pipe to stderr however >vh.txt redirects stdout to vh.txt so the file only contains messages sent to stdout and messages sent to stderr are not present.

You need to redirect messages to stderr to stdout and messages to stdout to your file. You can redirect messages to stderr to stdout using the syntax "2>&1" (pipe stream 2 to stream 1) so you whole command should be

del /F /Q D:\Oracle\CoreM id\Apache\Apach e\logs\*.* >vh.txt 2>&1
Jan 13 '11 #2
vhogan
2 New Member
Thanks Banfa, that was very helpful and what's more it worked first time!!!

Thanks again.

V
Jan 13 '11 #3
NeoPa
32,569 Recognized Expert Moderator MVP
There are three standard files associated with DOS (from Unix) programs :-
stdin
stout
stderr

Correctly written programs or filters will always send their error messages to stderr to avoid any potential of corrupting stdout (which may, of course, be used by another process as its stdin and is often parsed in a particular way - that doesn't include handling error text)

I must admit though (I haven't used any of it for a while mind) that I wasn't aware that stout could be reassigned from a DOS command line (although I have a vague recollection that I've always known it could be done in Unix). Nice one Banfa. I learned something today.
Jan 17 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1914
by: John Alleyman | last post by:
Hi there, Is there a simple way to prevent error messages (falsely connecting to database etc.) being diplayed? My own build in messages are enough... thanks, Chris
10
2309
by: r6uji7 | last post by:
hello, i am new to PHP programming and wondered if u could help. lets say i have the following files: 1. error.php: that is routed to for all errors. this page should display proper and explanatory error messages to the user based on the parameter provided. 2. errordef.php: has all the error codes and their explanations
1
1583
by: Kenneth McDonald | last post by:
I'm setting myself up to use Python with jEdit (after trying jed, VIM, others...urggh.) One small problem I'm having is that while jEdit has a nice plugin called Console which can be set up to run python scripts, and parse the result for errors which can then be used to put the editing cursor directly on the offending line, it doesn't play so well with the multiline error messages that Python generates. (Actually, I've never liked them a...
4
3515
by: seamus | last post by:
I transferred a new web that worked last week to my production server. Now none of my asp pages will display. Any suggestions?
2
1689
by: Stuart Palmer | last post by:
I have a little gripe with my ASP pages, for some reason I am not getting error messages I would expect and don't know if it's an ASP thing, browser thing or IIS problem. I use option explicit to ensure I define every variable. When I have forgotten to define one the error page just dislays the 500.100 error screen. I have ensured that in my IE 6 that 'show friendly http error messages' is unchecked but have the problem still.
3
1963
by: Shabam | last post by:
I know that dotnet allows for form field validation. However I'm looking to customize the error message display and am wondering if it's possible to do what I need. Example: Suppose in a form there is a "Name" field (required). The user leaves it blank and submits the form. I need to reload the page with the "Name" in red so the user can see which field(s) have errors in them.
1
1234
by: johnpeter887 | last post by:
On windows xp we can modify 500-100.asp file for custom asp error messages. How can we do this on a windows NT 4.0 and IIS. or what is the similar file on NT and IIS?
0
1166
by: Burkhard Schultheis | last post by:
I updated some of our machines with new packages. All machines run DB2 V7.2.8. On one machine only I saw this output from bind: db2 bind lzg_alar.bnd blocking no isolation ur LINE MESSAGES FOR lzg_alar.bnd ------ -------------------------------------------------------------------- SQL0061W The binder is in progress. That was all. No error message, no package created. If I redirected the error messages to a file I saw several error...
1
2650
by: intl04 | last post by:
I am getting strange print-related error messages when trying to create (not print!) reports. For example, when I click 'new' to create a report then choose 'design view', I get an error message that says: 'There was a problem retrieving printer information for this object. The object may have been sent to a printer that was unavailable.' When I choose 'report wizard', I can go through all of the steps but then I get an error message...
0
8503
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8419
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8844
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8642
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8696
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7472
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6254
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2836
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1836
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.