Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Capture psexec screen stdout

1,967 views
Skip to first unread message

nic...@hotmail.com

unread,
Feb 8, 2005, 7:48:33 AM2/8/05
to
Hi
How can I capture the screen output from psexec?

eg
psexec \\RemotePC -s net localgroup administrators MyDomain\MyUser /add
>out.txt

In this example, out.txt contains:
PsExec v1.31 - execute processes remotely
Copyright (C) 2001-2002 Mark Russinovich
www.sysinternals.com
Connecting to RemotePC...
Starting PsExec service on RemotePC...
Connecting with PsExec service on RemotePC...
Starting net on RemotePC...
net exited on RemotePC with error code 2.

however I want to capture the screen output aswell/instead:
The command completed successfully.
The specified account name is not a member of the local group.

Any help appreciated.
Nick

Ted Davis

unread,
Feb 8, 2005, 11:43:57 AM2/8/05
to

In some cases adding 2>1& after "> out.txt" ( > out.txt 2>1&) works,
but in the worst cases, you have to redirect the command output to a
file on the remote machine and STDERR to a file on the local machine
(2>), then retrieve the remote file and combine it with the local one.


T.E.D. (tda...@gearbox.maem.umr.edu)
SPAM filter: Messages to this address *must* contain "T.E.D."
somewhere in the body or they will be automatically rejected.

nic...@hotmail.com

unread,
Feb 9, 2005, 10:00:06 AM2/9/05
to
Thanks Ted, that worked perfectly.
Nick

0 new messages