PSEXEC - need help with command

June 20, 2011 at 06:32:44
Specs: Windows XP

I'm looking to write a basic command to install a windows patch remotely to a designated computer. This is what I have so far:

psexec \\myPC -c c:\temp\WindowsXP-KB2393802-x86-ENU.exe /silent

The problem is that it always returns an error code 0.
Can I get some help with this?


See More: PSEXEC - need help with command

Report •

June 20, 2011 at 13:26:47
Error code 0 is indicative of a successful completion of the command. Can you verify that the patch is or is not actually installed on the machine?

When troubleshooting error codes it can he helpful to check them by using the "net helpmsg #" where # is your error code number.

Report •

June 21, 2011 at 00:13:32
Hi Thanks for this. My programming knowledge is a little hazy as I havn't done anything for years now. Is there a way of reading in from a text file a list of hostnames, iterating through them and then install the patch on each one as well as outputing the results to a file called installed.txt?

Report •

June 23, 2011 at 08:58:35
I wasn't able to test this, but it should work:

@echo off
for /f in (computerlist.txt) do (
psexec \\%%A -c c:\temp\WindowsXP-KB2393802-x86-ENU.exe /silent
if !errorlevel! neq 0 echo %%a - errors reported >>errorreport.txt

Report •

Related Solutions

June 23, 2011 at 09:22:04
Thanks viddy - I see you've added the error handling as well - very nice.
Will give this a bash and let you know how I get on.

Report •

Ask Question