Page 1 of 1

psexec and ERROR: Input redirection...

Posted: 17 May 2012 22:09
by MKANET
I'm not sure if this post is outside the scope/expertise of the gurus here. So, I thought I would ask anyway.

I've been using psexec.exe alot in my scripts latetly to conveniently execute processes on remote servers. However, recently, I received the error message when running my batch file. However, I'm not exactly sure what's causing it. The odd thing is I was able to successfully do something very similar to this at the command line without any issues. If Im using input redirection, then I'm not doing it intentionally. As far as I know, all I'm doing is output redirection. If this is somehow a weird quirtwith psexec, maybe someone would know an alternate way?

ERROR: Input redirection is not supported, exiting the process immediately.

Code: Select all

%MYFILES%\psexec \\%UserInput% c:\windows\system32\mt.exe mediastatus tape0 2>NUL| find "No media in drive." 1>NUL 2>&1

Re: psexec and ERROR: Input redirection...

Posted: 18 May 2012 00:22
by foxidrive
The 2>&1 is superfluous as you'd redirected stderr in the leading command and find will never return stderr output in normal operation.