psexec and ERROR: Input redirection...

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Posts: 160
Joined: 31 Mar 2012 21:31

psexec and ERROR: Input redirection...

#1 Post by MKANET » 17 May 2012 22:09

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

Posts: 6033
Joined: 10 Feb 2012 02:20

Re: psexec and ERROR: Input redirection...

#2 Post by foxidrive » 18 May 2012 00:22

The 2>&1 is superfluous as you'd redirected stderr in the leading command and find will never return stderr output in normal operation.

Post Reply