Psexec Error Code -2146232576

batch-filecommand lineerror-codepsexecremote-access

I'm trying to open up a an .exe program that is on a remote computer through my main desktop using a batch file and psexec.exe.

I have been able to remotely kill programs using pskill, but when I run the command line required to open a program the window opens up for a fraction of a second before closing down due to an error. The error code it gives is: -2146232576.

I've tried Googling what this error actually is but I can't find much. Does anyone know for sure what this error relates to?

This is the batch file I made that does not work:

cd c:\Users\[local user]\Downloads\PSTools\
psexec.exe \\computername -u [user] -p [password] "C:\Users\[user]\Desktop\SQAUtilities\utlity.exe"

Note: I found a question on StackOverflow which is similar, but has a different error code:

psexec error code -1073740771

And also:

Error code 1073741502 when running psexec through TeamCity

This one has an answer that says the error is "a low-level .NET initialization error, the CLR cannot get loaded":

visual studio 2010: error code -2146232576 (0x80131700)

Best Answer

This is likely the exit code of utility.exe that PSExec is passing back to you, not an error generated by PSExec.

Here's one possible source: FIX: 0x80131700 error code when starting or configuring the Enterprise Single Sign-On Service

I don't know what utility.exe does, but if it attempts to perform Windows authentication, PSExec might be blocking it. In my experience, PSExec deliberately blocks some actions (under certain circumstances). For example, if you don't use a username/password, all attempts to access remote shares fails instantly. Since you're providing some creds, this might not be the precise problem, but if utility.exe requires access to your Kerberos tickets or something, they might not be accessible in a PSExec session.

Things to Try

  • Do you know that this command (utility.exe) works on the remote machines as your user when run interactively (GUI logon)? Surely you've already tried that, but just to make sure...
  • Is the build directory on the remote computer or is it a share on a third machine? The method of accessing those files might require more steps within PSExec (like mapping a drive, etc.).
  • If the program absolutely requires a GUI, you may have to allow it to interact with a specific GUI session using the -i parameter of PSExec. You might try logging into the remote machine, running the command with -i 2 (or whatever session qwinsta tells you you're using—2 is common for remote desktop connections) and see if it opens any error dialogs that are more informative.
  • You might try running ProcMon on the remote machine while you run the PSExec command and seeing if there are any ACCESS_DENIED or other failures that it notices.