Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any alternative utility to replace PsExec? If I mostly use batch script for automation work. Due to instability of psexec, like hanging/ not responding, I may need another solution. Can the community advise, thanks.

EDIT: I have 2 particular issues with psexec.


  2. I have a ASP.NET web service which only invoking psexec from remote SOAP API calls. Everyday when I check, I can see 10-20 psexec hanging in task manager. During the peak time, the web server receives about 1-5 requests, but it probably lasts for only 5 minutes. Below is my code.

Process psexecProcess = new Process();
ProcessStartInfo psi = new ProcessStartInfo("PsExec.exe");

string psexecArg = "-u " + GetRemoteAccount(serverType) 
+ " -p " + GetRemotePW(serverType) 
+ " \\\\" + GetManagementServerIP(serverType) 
+ " C:\\MyBatchScript.bat " + username;           

//set process options
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
psi.RedirectStandardInput = true;
psi.WindowStyle = ProcessWindowStyle.Hidden;
psi.CreateNoWindow = true;
psi.Arguments = psexecArg;  //set psExec command

psexecProcess.StartInfo = psi;
psexecProcess.Start();     //run PsExec

StreamReader reader1 = psexecProcess.StandardError;
string result1 = reader1.ReadToEnd();

StreamReader reader2 = psexecProcess.StandardOutput;
string result2 = reader1.ReadToEnd();


So that why I feel so frustrated with psexec.Can the community help me find anything wrong with both of these issues? Please advise, thanks.

EDIT2: I also need an alternative for 64-bit servers (for Windows Server 2003 64-bit).

share|improve this question
What type of instability are you actually seeing? Perhaps you should be asking a question about your psexec issues somewhere? – Zoredache Jan 26 '11 at 22:02

PowerShell 2 has the ability to do remote execution of files.

share|improve this answer
Do I need to install PowerShell 2 on both local and remote host? – Stan Feb 28 '11 at 13:56
@stan I'm pretty sure that's the case. – sysadmin1138 Feb 28 '11 at 15:20

I'm going to second Zoredache's point.PsExec is pretty good at what it does. If something is hanging, it may be the programs that you're calling, and an alternative won't necessarily do any better.

If you're trying to interact (via script) remotely however, then something like Expect is a better solution. Can you provide more details on what you're trying to do?

share|improve this answer
Updated my question. – Stan Jan 29 '11 at 1:34

Power Admin recently released PAExec which is supposed to be a PsExec replacement.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.