Save batch window msgs to a file from the batch prog

S

Stephen Rainey

Hi, not sure if this is the correct forum.
I am running batch backups on my XP SP2 system.
From the batch file, I want to select all msgs in the window, and copy them
to a file for archive purposes.
Simple to do manually. Any suggestions how to automate this task from the
running batch file?
 
B

Bill James

Most command you can redirect to a file using the > and >> characters. > replaces current content, >> appends to the file.

ping google.com > c:\ping.txt
ping yahoo.com >> c:\ping.txt
 
S

Stephen Rainey

Thanks Bill, however, I am already making extensive use of output
redirection. I find that XCOPY will send certain information to the
"console" irrespective of the redirection.

I guess I am looking for a way to "select all", "save" to "filename", from
within the window.

Most command you can redirect to a file using the > and >> characters. >
replaces current content, >> appends to the file.

ping google.com > c:\ping.txt
ping yahoo.com >> c:\ping.txt
 
P

Paul Johnson

Stephen said:
Thanks Bill, however, I am already making extensive use of output
redirection. I find that XCOPY will send certain information to the
"console" irrespective of the redirection.

Unfortunately, DOS and it's successors never really got pipes or redirection
right, and it doesn't work as expected with all programs, even if they did
come from Microsoft. Windows redirection and pipe shortcomings are
eliminated on windows if you work from a Cygwin Bash prompt instead of a
Microsoft cmd prompt. http://www.cygwin.com/
I guess I am looking for a way to "select all", "save" to "filename", from
within the window.

Redirection is how you do exactly that. I bet if you try the same thing in
Cygwin Bash with cp instead of xcopy, you can make it do exactly what
you're trying to do successfully.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top