Solved

Want output of a batch file

Posted on 2001-07-20
26
1,324 Views
Last Modified: 2007-11-27
I run a batch file (in a DOS window in WIN98-SE), called filecopy.bat
Essentially it copies lots of files to a backup directory.

The batch file sends to the screen various messages of output, like

"1 file copied"
 "8 files copied"
 "0 file copied"
  "Access denied"

But it scrolls by too quickly.

So I need a way to get the screen output sent to a .txt file.
(I asked this question in the WIN98 section, but no one could figure it out.)
0
Comment
Question by:cma1
  • 5
  • 5
  • 5
  • +7
26 Comments
 
LVL 7

Expert Comment

by:rin1010
ID: 6303515

cma,

Do you need to log the output of all the commands in your batch file?
Different methods may be needed depending on the specific command,
but typically you can pipe the output to a file using redirection characters.
For example, if you have a batch file like this:

@echo off
copy file1.ext c:\temp
copy *.txt c:\temp

...you could log the screen output to a file named log.txt like this:

@echo off
copy file1.ext c:\temp > log.txt
copy *.txt c:\temp >> log.txt
notepad log.txt

The first "greater than" redirection character creates the log.txt file
and writes the batch command's output to the file.
Subsequently using two redirection characters appends the next command's output
to the file. If only one redirection character is used, it overwrites the log file if it exists,
creating a new log. You can do that each time, or use two characters on the first command
to append the results to a previously created log file. Or perhaps have your batch file
copy the log elsewhere if you need to save it.
(The last line is just to open the log file in Notepad.)

Other commands can be combined to format the output
depending on exactly what you want logged.
If this isn't what you need, post back with your batch file, if possible,
and which of its commands you need to log and we'll get it to work.
 


0
 
LVL 24

Expert Comment

by:SunBow
ID: 6303937
To slow the scroll there are several techniques like <ctrl>S or use of the KB key <pause>, but being lazy, I usually use similar redirects, sometimes with a command to CD, and usually with command to also redirect the date, maybe even the time if the logfile is to remain around awhile.

I usually code the same...
Except the last line would be either:
Type log.txt
or:
Type log.txt|more

In your case I'd use the latter, for you seem to want the scroll help. Drawback if not on Win2K is that to go back you'd have to manually reenter the command to display it on-screen. Advantage is you don't need windows. Without Windows running (perhaps exiting to DOS before Win9x kicks in) you could include the Edit command.

:-)    Thanx Rin, I do usually run in Windows, and keep a NotePad window open, on the side, to view it, but for some reason never thought to actually run it from within the batch command itself! My Gosh!
0
 

Author Comment

by:cma1
ID: 6304259
Rin, I am not quite sure what you are saying to do.

 I want a log of the screen output.
 Are you saying to insert > log.txt after each line,
or just the first line, with >> log.txt in the all subsequent lines or
> log.txt in the first line
>> log.txt in the second line
>>> log.txt in the third line, etc.?

I am simply trying to get a log of the screen output.
I thought that there was some simple DOS command that would do that.





@echo off
copy file1.ext c:\temp > log.txt
copy *.txt c:\temp >> log.txt
notepad log.txt

The first "greater than" redirection character creates the log.txt file
and writes the batch command's output to the file.
Subsequently using two redirection characters appends the next command's output
to the file. If only one redirection character is used, it overwrites the log file if it exists,
creating a new log. You can do that each time, or use two characters on the first command
to append the results to a previously created log file. Or perhaps have your batch file
copy the log elsewhere if you need to save it.
(The last line is just to open the log file in Notepad.)

0
 
LVL 7

Expert Comment

by:rin1010
ID: 6304926

Hi cma... Essentially what I was saying is the second scenario you mention;
append  > log.txt  to the end of the first line to be logged,
then append  >> log.txt  to each subsequent line.

Using only one redirection character will create a new file having the name specified,
(in this case log.txt) or will overwrite a file with that name if it exists.
Using two of these redirection characters will append to the file.

Alternatively, if you use two characters on the first line (as well as all other lines)
it will either create a new file having the name specified (if it doesn't exist)
or will append to a file with that name if it does exist. (e.g., if adding to a previous log)
So using one character either creates or overwrites and using two characters append.

Please wait just a little while and I'll provide some more info that I think you can use...
Was wondering if your batch script has many commands, or just a few,
and whether you need to log only the results of the COPY command...
(i.e., as opposed to XCOPY or any other commands you may have in the script.)
With your script I could offer some specific suggestions, though it's not necessary
and can still provide some examples which can be adapted to your situation.
But wanted you to know I saw your post and will respond further directly.
 
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 6305530
You all may want to look at this link for some background info where cma1 was redirected to this TA.
http://www.experts-exchange.com/jsp/qShow.jsp?ta=win98&qid=20154035

Basically what cma1 is wanting is to log only the amount of files copied and any/all error messsages.
0
 

Author Comment

by:cma1
ID: 6305537
Crazyone has what I am after. I have many Copy commands in the batch file.
 I just want the screen output, which shows the result of each copy operation.
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 6305557
Umm everybody this does not have anything to do with this Q but I think it is improtant if you all would take a look at this link in Community Support.

http://www.experts-exchange.com/jsp/qShow.jsp?qid=20154895
0
 
LVL 12

Expert Comment

by:Otta
ID: 6305718
> I asked this question in the WIN98 section:

http://www.experts-exchange.com/jsp/qShow.jsp?ta=win98&qid=20154035

> but no one could figure it out.

Nonsense.  In that section, use of the '>' redirection was suggested, several times.

If you are trying to run 'MYPROG.BAT',
and want the output written to 'MYOUTPUT.TXT', type:

   MYPROG > C:\MYOUTPUT.TXT

That's all!
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 6306012
cma1 is correct when logging the command it does not log any of the error messages that appear on the screen. For example I ran this bat file from the Start > Run while in Win 2000 and this is the result:

the command in the bat file is this
copy C:\WINNT\system32\config\*.* c:\~~~

the Run line command is this
C:\~~~\copy.bat >c:\~~~\Filecopy.txt
------------------------------------------

The Log file

C:\WINNT\system32\config\USERDIFF
C:\WINNT\system32\config\SYSTEM.SAV
C:\WINNT\system32\config\SOFTWARE.SAV
C:\WINNT\system32\config\DEFAULT.SAV
C:\WINNT\system32\config\NTUSER.DAT
C:\WINNT\system32\config\USRCLASS.DAT
C:\WINNT\system32\config\SecEvent.Evt
C:\WINNT\system32\config\IExplore.evt
C:\WINNT\system32\config\SECURITY
C:\WINNT\system32\config\SYSTEM.ALT
C:\WINNT\system32\config\SAM
C:\WINNT\system32\config\SYSTEM
C:\WINNT\system32\config\SOFTWARE
C:\WINNT\system32\config\DEFAULT
C:\WINNT\system32\config\AppEvent.Evt
C:\WINNT\system32\config\SysEvent.Evt
       10 file(s) copied.
-------------------------------------------------

The DOS screen

C:\WINNT\system32\config\USERDIFF
C:\WINNT\system32\config\SYSTEM.SAV
C:\WINNT\system32\config\SOFTWARE.SAV
C:\WINNT\system32\config\DEFAULT.SAV
C:\WINNT\system32\config\NTUSER.DAT
C:\WINNT\system32\config\USRCLASS.DAT
C:\WINNT\system32\config\SecEvent.Evt
C:\WINNT\system32\config\IExplore.evt
C:\WINNT\system32\config\SECURITY
The process cannot access the file because it is being used by another process.
C:\WINNT\system32\config\SYSTEM.ALT
The process cannot access the file because it is being used by another process.
C:\WINNT\system32\config\SAM
The process cannot access the file because it is being used by another process.
C:\WINNT\system32\config\SYSTEM
The process cannot access the file because it is being used by another process.
C:\WINNT\system32\config\SOFTWARE
The process cannot access the file because it is being used by another process.
C:\WINNT\system32\config\DEFAULT
The process cannot access the file because it is being used by another process.
C:\WINNT\system32\config\AppEvent.Evt
C:\WINNT\system32\config\SysEvent.Evt
       10 file(s) copied.
---------------------------------------------------------

So the error messages are not making it to log file but cma1 wants these messages in the log file.
0
 
LVL 12

Expert Comment

by:Otta
ID: 6306246
> the error messages are not making it to log file but cma1 wants these messages in the log file.

Under DOS, first use the 'CTTY' command to divert _all_ output, not just "standard output".
Then, run the '.BAT' command.
Then, use 'CTTY' again, to "cancel" redirection.
0
 

Author Comment

by:cma1
ID: 6306294
Crazyone, you have it exactly right.
MYPROG > C:\MYOUTPUT.TXT does not work for the reasons you cited.
0
 
LVL 7

Accepted Solution

by:
rin1010 earned 200 total points
ID: 6310754

cma,

Sorry for the delayed response... I'd put together a few notes and methods
to log your copy process results, going on the info you provided
about having a batch file that "copies lots of files to a backup directory"
but now I see the additional info here...
Most of what I wrote is probably not applicable to what you want so I'll try again...

You mention the "x file(s) copied" messages and "Access denied" message
and I wondered if you also need to log the listing of the filenames that scroll by...
I presumed an ongoing log, but is this merely to troubleshoot the errors mentioned?
You say there are "many Copy commands in the batch file..."
Your example of the "8 files copied" message indicates that some of your
COPY commands uses wildcards? I figured a batch file with a just a few lines like
"copy c:\windows\*.* c:\bakupdir" but is it that you have too many COPY commands
to easily edit? As indicated, you're "trying to get a log of the screen output."
and refer to "some simple DOS command that would do that."
The commands are simple, but may need to be coded at various places
throughout the script. And note that what is logged and how it's logged
may be specific to the command.

Your examples posted of the "various messages" suggest the COPY command...
(With XCOPY you may get "Access is denied"...) When the COPY command
generates the two-word variation (Access denied) it's usually when trying to
overwrite a file having its Read-Only attribute set. At that point the batch script
may terminate, logging is discontinued and additional messages
won't occur in the log anyway.

So if you're trying to gather info on COPY errors that occur when running your batch file,
it may be best to first eliminate known potential errors... Then you may need to
rewrite the script using alternate commands. (Seeing the batch script might change things
but it shouldn't be too difficult... even using a text editor's find/replace feature
to edit a very long script...) But other commands can eliminate some of the errors
and better show you what is occurring.

For example, the "Access denied" message generated when trying to
copy over a Read-Only file can be eliminated by first using ATTRIB to clear the attributes
of existing files in the directory to where you're copying.
To clear the Read-Only, System and Hidden attributes of all files
in the C:\BakupDir and all its subdirectories before copying there,
add the ATTRIB command before the copy process begins in your script, like:

ATTRIB -R -S -H C:\BakupDir /S

Some of these error messages are generated in Windows by kernel32.dll and
won't necessarily be redirected to a file (nor would apply in DOS mode.)
An example is the "Sharing Violation" error which you may be getting.
If you try to copy a file that is "in use" such as the Windows swap file,
you'd see something like:

Sharing violation - C:\WINDOWS\WIN386.SWP
        0 file(s) copied
 
Trying the same thing with XCOPY you'd get a message similar to:

Error copying file C:\WINDOWS\WIN386.SWP ...
The process cannot access the file because it is being used by another process.
        0 File(s) copied

The "0 file(s) copied" is logged but the remaining portion is not.
(In DOS mode, the file won't be "in use" and can be copied or deleted or whatever,
so the error wouldn't occur. The circumstances depend on what you're copying
and whether your script contains only COPY commands.)
The error messages pertaining to COPY mentioned above,
and others you may be concerned with such as
"Invalid directory," "Invalid filename," "File not found," "Invalid path," etc.,
may not be redirected but will still write the message "0 file(s) copied" ...
If you do a command like this:

COPY C:\Windows\*.* C:\BakupDir >> ~Results.txt

...you'll get a list of the filenames, etc, redirected to ~Results.txt ...
(If copying "lots of files" as you say, you may not see screen activity,
as it's now being redirected to the file. Without checking for drive activity,
it may not be apparent that something's happening.)
Doing it like that, the generated list wouldn't tell you much...
But if you call each file individually using the FOR command, like:

FOR %%x in (C:\Windows\*.*) do COPY %%x C:\BakupDir >> ~Results.txt

...you'll get a list having the results of the command that is run on each file, like:
"1 file(s) copied", "0 file(s) copied", "1 file(s) copied," and so on...
(The "0 file(s) copied" message is also generated when trying to copy a zero-byte file,
which won't be copied.)

But the COPY procedures above would probably fail on the mentioned errors
and even if not, neither of the logs produced would be very useful...
So the idea is to substitute XCOPY and use it for the copy process and
get its differing output to create a useful log... Mostly though, XCOPY has features
more suitable to copying numerous files, especially in Windows...
I'll add some info about it, but here's a way to get all of the error messages in Windows
to a hard copy or file.

You can use the CTTY command to choose the output device and
can change the device from the console (CON) to the printer (PRN) ...
This will write the output to the printer port including the
Windows generated messages not logged.
The syntax in a batch script would be like:

CTTY PRN
COPY C:\Windows\*.* C:\BakupDir
CTTY CON

Add CTTY PRN to the beginning of the script and be sure to send control
back to the console device (CTTY CON) at the end of the script.
This method will allow you to print the entirety of what you indicate is
scrolling by on the screen too fast. Of course, with an extensive script,
there's a question of printer paper, so you probably wouldn't want to
log this way each time.

But you can use this method and tell Windows to "print to a file" instead of to the printer
and create your text log of the batch process. A way to do it is like this:
Open the Printer app and do "Add Printer" to run the Wizard...
From the list of "Manufacturers" choose "Generic"
and then choose "Generic/Text Only"...
Now print to that driver when you want to create the log file.
(You'll be prompted for a filename or you can designate a permanent name.)
With that and those two CTTY commands you can log everything.

Here's some more info about using XCOPY instead of COPY in your script...
Substituting XCOPY in my previous FOR example to copy and create a log, like:

FOR %%x in (C:\Windows\*.*) do XCOPY %%x C:\BakupDir >> ~Results.txt

...produces a log having both the filename and the results. So using the above,
if the Windows directory contains WIN.INI, SYSTEM.INI and WIN386.SWP
and the BakupDir already contains a SYSTEM.INI with its Read-Only attribute set,
you'd get a log similar to:

WIN.INI
        1 File(s) copied
SYSTEM.INI
        0 File(s) copied
WIN386.SWP
        0 File(s) copied

Another benefit of this is that the output above is redirected to the ~Results.txt file,
but only the "unlogged" error messages are displayed on the screen, like:

Error copying file C:\WINDOWS\SYSTEM.INI to C:\BAKUPDIR\SYSTEM.INI
Access is denied.
Error copying file C:\WINDOWS\WIN386.SWP to C:\BAKUPDIR\WIN386.SWP
The process cannot access the file because it is being used by another process.

Since the other filenames aren't displayed on screen, the error messages will appear slowly
as they occur. It would then be possible to use the Pause key (if necessary with many errors)
and/or print the screen to get only the error messages.

To eliminate the copy process failing, you can use the XCOPY /C switch,
which allows it to continue copying when errors occur.
So with the FOR command it would be like:

FOR %%x in (C:\Windows\*.*) do XCOPY/C %%x C:\BakupDir >> ~Results.txt

There are other useful XCOPY switches when copying one or multiple files in Windows,
especially for batch use... The /Y switch tells XCOPY to not prompt for Yes or No
when attempting to overwrite an existing file from the command prompt,
but you can produce the same results of displaying only error messages to the screen
(and not all the filenames) using the /Q (quiet) switch like:

XCOPY /Q /C /Y C:\Windows\*.* C:\BakupDir

That may be all you need to simply see the errors.
Here are other handy XCOPY switches under Windows:

   /H   Copies Hidden and System files...
   /R   Overwrites Read-Only files...
   /S   Copies Directories and SubDirectories under the specified directory...
           (Can eliminate having to CD\ to numerous directories...)

Also, if you're periodically backing up the same group of files,
the XCOPY /D switch will copy only files that have been modified since the last backup.
That way you're not redundantly copying the same exact file each time.
Although you may have to redo portions of your script,
XCOPY can give you much more control.

If you create a ~Results.txt file using these commands:

FOR %%x in (C:\Windows\*.*) do XCOPYH/C/R/D %%x C:\BakupDir >> ~Results.txt

...you could then open and scan the ~Results.txt file for the string "0 File(s) copied"
and easily see the name of the file that wasn't copied.
You could also use FIND to isolate and write only that string to another file, like:

FIND/i " 0 File(" ~Results.txt >> ~CopyLog.txt

If testing the above, note that the two redirection characters will append to a file each time.
To create a new file, the existing copies should be deleted first, e.g., :

@echo off
cls
if exist ~Results.txt del ~Results.txt
if exist ~CopyLog.txt del ~CopyLog.txt
FOR %%x in (C:\Windows\*.*) do XCOPY/H/R/C %%x C:\BakupDir >> ~Results.txt
FIND/i " 0 File(" ~Results.txt >> ~CopyLog.txt

The " 0 File(" parameter of the FIND command is a portion of the string being sought
and can be replaced with whatever line you want to cull from the file.
The /i switch tells FIND to ignore case in the search string.

Using XCOPY and the appropriate switches you should be able to reduce the errors
to just the "Sharing Violation" error and would know that any occurrence of "0 File(s) copied"
would pertain to that error. If necessary, once the files are identified,
a separate script could copy those files in DOS mode.

Hopefully some of this will work for you... Otherwise post back with exactly what
and why you need logged and perhaps the batch script...
Some shortcuts or better methods to log may be found, or you can email it if you want,
but please ask if you have other questions about it...
 
0
 
LVL 12

Expert Comment

by:Otta
ID: 6310923
It's curious that 'CTTY' was first mentioned on 7/23 in this question,
but was first mentioned on 7/22 in your other question, at:
http://www.experts-exchange.com/jsp/qShow.jsp?ta=win98&qid=20154035

Plagiarism, or two great minds thinking alike?  :-)
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Expert Comment

by:Ugi
ID: 6311330
You can simply log the Output on STDOUT and STDERR with:
Command  >log.txt 2>&1

For append use:
Command >>log.txt 2>>&1

("Command" stands for your instruction)
0
 
LVL 7

Expert Comment

by:rin1010
ID: 6315821

Who are you addressing regarding the plagiarism comments, Otta,
and what's your point?
 
0
 
LVL 12

Expert Comment

by:Otta
ID: 6316104
> Who are you addressing regarding the plagiarism comments, Otta,

If the shoe fits you ...

> and what's your point?

The chronology speaks for itself ...

1 http://www.experts-exchange.com/jsp/qShow.jsp?ta=win98&qid=20154035
1
1 From: Otta                                                              
1 Date: 07/22/2001 02:15PM PST
1 Use the 'CTTY' ("change TTY") to divert _all_ output.
____________

2 http://www.experts-exchange.com/jsp/qShow.jsp?ta=msdos&qid=20154458
2
2 From: Otta
2 Date: 07/22/2001 09:15AM PST
2
2 Under DOS, first use the 'CTTY' command

3 From: rin1010
3 Date: 07/23/2001 06:34PM PST
3
3 You can use the CTTY command to choose the output device ...

To repeat, plagiarism, or great minds thinking alike?
You make the call.

0
 
LVL 10

Expert Comment

by:Nushi
ID: 6331455
why not using the |more options?
type more /? in the command line.

Nushi.
0
 

Expert Comment

by:ComTech
ID: 6382705
It's time to clean up this topic area and that means taking care of this question. Your options at this
point are:

1. Award points to the Expert who provided an answer, or who helped you most. Do this by clicking on
the "Accept Comment as Answer" button that lies above and to the right of the appropriate expert's name.

2. PAQ the question because the information might be useful to others, but was not useful to you. To
use this option, you must state why the question is no longer useful to you, and the experts need to
let me know if they feel that you're being unfair.

3.  Ask Community Support to help split points between participating experts.  Just comment here with
details.

4.  Delete the question because it is of no value to you or to anyone else.  To use this option, you
must state why the question is no longer useful to you, and the experts need to let me know if they
feel that you're being unfair.

If you elect for option 2, 3 or 4, just post comment with details here and I'll take it from there.
 We also request that you review any other open questions you might have and update/close them.  Display
all your question history from your Member Profile to view details.

PLEASE DO NOT AWARD THE POINTS TO ME.

____________________________________________



Hi Experts:

In the event that the Asker does not respond, I would very much appreciate your opinions as to which
Expert ought to receive points (if any) as a result of this question.  Likewise, you can also suggest
that I PAQ or delete the question.

Experts, please do not add further "answer" information to this question.  I will be back in about one
week to finalize this question.

Thank you everyone.

ComTech
Community Support Moderator @ Experts Exchange
0
 
LVL 3

Expert Comment

by:FlamingSword
ID: 6399210
PAQ it (content + cross_threads)
0
 
LVL 12

Expert Comment

by:Otta
ID: 6399773
ComTech, please check:

http://www.experts-exchange.com/jsp/qShow.jsp?ta=win98&qid=20154035

for an identical question, by the same author.
0
 

Expert Comment

by:ComTech
ID: 6400416
cma1, as it stands, you are in for 200 points in this question, 100 here and 100 in Windows98 Area.

It would be helpfull to get these questions to come to an end, and resolve both. At this moment, it very well could cost you 200 points.

Thank you,
ComTech
Community Support Moderator

Ps.  As it is now, I cannot delete either, as Experts have put time and effort into both.

I posted a message at theother siet as well.
0
 
LVL 7

Expert Comment

by:rin1010
ID: 6402458

These comments are addressed to "Otta" in response to the petulant complaints above...
I meant to remain indifferent to this puerile contention, but as Otta's accusations
appear directed at me personally and considering the recent activity and 'cross_threads'
I should reply for the record.

(My apologies to cma1 for cluttering your question with pettiness...
I see in your other question concerning logging these specific messages
that you may have thought you deleted that one, but hopefully
some of the methods in this thread will give you the necessary info.)

Otta; There'd be less spam if you'd simply say what you mean...
If you have problems and think something is wrong here, take it up with Customer Service...
-else have the courage to address someone directly and cut the innuendo.

Regarding the CTTY thing; I wrote and tested portions of those comments
during the weekend before you posted anything about it, unaware that cma
had a question elsewhere... I composed that long before you referenced ctty...
Then I receive notification that you've joined the thread and (unsurprisingly)
see you calling questioner cma's comments "nonsense" and repeating a suggestion
which cma had already informed you doesn't work...
(btw... nfernand posts the correct syntax;  "command.com /c batchfile.bat > log.txt"
if you want to see how to do it... But even so, 'your' method still doesn't provide a solution.)

You say it's "curious" that someone uses a command "mentioned" elsewhere by you...
That's your definition of plagiarism? I've dealt with many other questions regarding
the ctty command... Surely you don't think it's some undocumented secret
that only you're aware of? Are you implying nobody would've considered it
had you not brought it up? (you can call me al...) Note that I mention "redirection"
before you come in talking about it... How is that defined?
Regardless, you should take time to learn how to use a command
before commenting on it. Here's the gibberish from your two posts about it:

<<<<
Under DOS, first use the 'CTTY' command to divert _all_ output,
not just "standard output". Then, run the '.BAT' command.
Then, use 'CTTY' again, to "cancel" redirection.
>>>>

<<<<
Use the 'CTTY' ("change TTY") to divert _all_ output.
Run your '.BAT' file.
Use 'CTTY' to "cancel" the diversion.
Works under DOS!
>>>>

So what does that mean? How do you use the ctty command?
Where do you direct the output? In essence it means nothing...
You must supply a device name... The above will only generate an error
and waste someone's time... It won't work "under DOS" as you state
nor under Windows (which is what the question is about.)
So perhaps you can supply a working example (as I did)
of using ctty to log all of the screen output to a text file.
And btw... CTTY is an acronym for "Console TeleTYpe" ...
Not "change TTY" as you misstated.

And you still haven't expressed your point... Do you think you deserve some credit?
Fine with me... I suppose that's up to cma1... I've simply provided my notes on the
differing error messages and a few tested methods to first obviate some of the problem.
I wasn't even sure what messages needed logging until cma's confirmation
to the additional information CrazyOne posted. I provide methods to log all the messages
and the ctty thing is only a fraction of my input. I gave instructions and workarounds
in hopes of covering most situations. I tested everything proffered and it works as required.
I have no idea yet whether it will be of any use to cma... they're merely suggestions to try.
If you can find fault with any of it then please debug and redress it...
And if you can come up with a solution that works for cma, then that's even better.

Bottom line; keep your insinuations to yourself or complain in an appropriate manner.
A moderator monitors this ta to whom you can complain, who knows the subject
and probably doesn't want this unprofessionalism here. (Apologies to ComTech for mine.)
But if you want a couple more reasons why it's inconceivable
that I'd plagiarize your offered nonsense, please ask...
 
0
 

Expert Comment

by:ComTech
ID: 6402682
First, I would like to tell cma1, I did PAQ your question in Windows98 TA, as the Experts there agreed.  Do you wany me to add the other 100 points to this question?

Regards,
ComTech
Community Support
0
 

Expert Comment

by:ComTech
ID: 6402744
I don't see any plagiarism about CTTY, most commonly used by the terminal device. The valid ports are: CON, AUX, COM1-4, LPT1-3, and NUL.

It's late, and I refused to go into detail about CTTY and it's effect in Dos commands and batch files.  I will assure both, that it has been around for quite awhile, and have not known of any Copyrights.

Otta, just because you are aware of CTTY and it's uses, you're explination is not as explained enough for a new user, and that is how we have to look at most users, therefore they need more education and how to.

Before any of this started, I had an idea of who to award the question to, and since the user has not returned.  

The question will go to rin1010 for his intensive instructions.

As the user did not return to either question, the points here in this TA will be doubled.

Thanks all,
ComTech
Community Support

0
 

Expert Comment

by:ComTech
ID: 6402746
Just a note, I hold myself exclusivily responsible for my own actions.

Regards,
ComTech
0
 

Expert Comment

by:easoccer
ID: 8124811
This thread is over, but I'd like to point out for future surfers that Ugi's answer was right on the mark:

-Start--------------------------------------
You can simply log the Output on STDOUT and STDERR with:
Command  >log.txt 2>&1

For append use:
Command >>log.txt 2>>&1

("Command" stands for your instruction)

-End----------------------------------------

Very complete and concise. (e.g. manycopys.bat >log.txt 2>&1)

The batch file itself does not have to be modified.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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