WIndows .CMD Redirect

Score
0
Vote Up
February 23, 2007 at 09:24:44 Pacific
Specs: WinXP, Various

Guys - On Linux I can:

acmd >>my.log 2>>my.log

and this works perfectly.

On this WInXP box if I try that, I get message:

The process cannot access the file because it is being used by another process.

Is there a way to accomplish what I am trying to do?

Thanks, Guy



Reply ↓  Report •


#1
Vote Down
Score
0
Vote Up
February 23, 2007 at 11:03:52 Pacific

What are you trying to do exactly? Redirect the output to 2 seperate files? If so:

dir file.txt 2>&1

"Computer security." — Oxymoron


Reply ↓  Report •

#2
Vote Down
Score
0
Vote Up
February 23, 2007 at 17:04:33 Pacific

No, not separate files.

I want to redirect stdout and stderr to the same file.

Output of those streams should be mingled/merged in the specified file.

Maybe I am asking the wrong question.

On linux I will do:

somecmd 2>&1 | tee logfile.txt

How do I do that in Win?

G.



Reply ↓  Report •

#3
Vote Down
Score
2
Vote Up
February 23, 2007 at 21:18:56 Pacific

I think somebody, probably IVO, posted a fix a few months ago but I can't find it. LOL

Maybe a new thread with a subj like 'redirect stderr in NT'.


=====================================
If at first you don't succeed, you're about average.

M2



Reply ↓  Report •

#4
Vote Down
Score
3
Vote Up
February 24, 2007 at 02:23:56 Pacific

SomeCmd > My.log 2>&1

as explaneide by

http://www.microsoft.com/resources/...



Reply ↓  Report •

Related Posts

#5
Vote Down
Score
1
Vote Up
February 24, 2007 at 11:10:42 Pacific

Thanks, that does it.


Reply ↓  Report •

#6
Vote Down
Score
0
Vote Up
February 26, 2007 at 08:58:48 Pacific

Lol, sorry, thats what I meant, I just forgot the first >. Oops

"Computer security." — Oxymoron


Reply ↓  Report •

Reply to Message Icon Start New Discussion
« decimal numbers in DOS Getting Win/MsDos Date Va... »

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.

Ask the Community!
Describe your Problem
Example: Hard Drive Not Detected on My PC