Pipe command output to a file and not console

At the risk of having probably overlooked some commands again, I have
another question :slight_smile:

I have troubles to pipe a command’s output to a file. I don’t want the
output to go to the console, only to the file. So I tried to use the .shell
command to redirect the output of a command to a file like this (I use lmv
as an example):

.shell -ci “lmv; .shell_quit” copy con c:\foo.log

which fails miserably. using “cmd.exe /c copy con c:\foo.log” doesn’t help
much.

I tried to code a small “cat” program without luck

.shell -ci “lmv; .shell_quit” c:\mycat.exe > c:\foo.log

Is there a simpler way to do this? I don’t want to use
.logopen/.logappend/_NT_DEBUG_LOG_FILE_XXX since I don’t want the output to
go to the console too.

By the way, in the .shell documentation, I think the last example is
incorrect. Shouldn’t it be:

.shell -ci “!process 0 7” perl.exe parsemyoutput.pl

I’ll write an extension to do this if I can’t find a better way.

M-A

Nothing builtin will do this. Although if you have a cat which sends
stdin to stdout, this will do it:
.shell -ca “” -o cat

Jason

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Marc-Antoine
Ruel
Sent: Monday, April 25, 2005 8:23 AM
To: Kernel Debugging Interest List
Subject: [windbg] Pipe command output to a file and not console

At the risk of having probably overlooked some commands again, I have
another question :slight_smile:

I have troubles to pipe a command’s output to a file. I don’t want the
output to go to the console, only to the file. So I tried to use the
.shell
command to redirect the output of a command to a file like this (I use
lmv
as an example):

.shell -ci “lmv; .shell_quit” copy con c:\foo.log

which fails miserably. using “cmd.exe /c copy con c:\foo.log” doesn’t
help
much.

I tried to code a small “cat” program without luck

.shell -ci “lmv; .shell_quit” c:\mycat.exe > c:\foo.log

Is there a simpler way to do this? I don’t want to use
.logopen/.logappend/_NT_DEBUG_LOG_FILE_XXX since I don’t want the output
to
go to the console too.

By the way, in the .shell documentation, I think the last example is
incorrect. Shouldn’t it be:

.shell -ci “!process 0 7” perl.exe parsemyoutput.pl

I’ll write an extension to do this if I can’t find a better way.

M-A


You are currently subscribed to windbg as: xxxxx@winse.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

That did the work except with -ci instead of -ca :slight_smile:

I did try with the -o option but I must have malformed the command when I
did try it.

Thanks!

M-A

“Jason Shay” a écrit dans le message de news:
xxxxx@windbg…
Nothing builtin will do this. Although if you have a cat which sends
stdin to stdout, this will do it:
.shell -ca “” -o cat

Jason

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Marc-Antoine
Ruel
Sent: Monday, April 25, 2005 8:23 AM
To: Kernel Debugging Interest List
Subject: [windbg] Pipe command output to a file and not console

At the risk of having probably overlooked some commands again, I have
another question :slight_smile:

I have troubles to pipe a command’s output to a file. I don’t want the
output to go to the console, only to the file. So I tried to use the
.shell
command to redirect the output of a command to a file like this (I use
lmv
as an example):

.shell -ci “lmv; .shell_quit” copy con c:\foo.log

which fails miserably. using “cmd.exe /c copy con c:\foo.log” doesn’t
help
much.

I tried to code a small “cat” program without luck

.shell -ci “lmv; .shell_quit” c:\mycat.exe > c:\foo.log

Is there a simpler way to do this? I don’t want to use
.logopen/.logappend/_NT_DEBUG_LOG_FILE_XXX since I don’t want the output
to
go to the console too.

By the way, in the .shell documentation, I think the last example is
incorrect. Shouldn’t it be:

.shell -ci “!process 0 7” perl.exe parsemyoutput.pl

I’ll write an extension to do this if I can’t find a better way.

M-A


You are currently subscribed to windbg as: xxxxx@winse.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com