batch compare rework


Yes, I would like.

>I'd like to check a couple of things:
>-Do you want to scan remote machines, as well as your own?
>-If so, do you have a list of all the machines in a file? (for example), or do you need to use another utility, or another...?

Yes, mainly remote, I do most of this srcipting from one of my servers
Yes, I have a list it is a single column *.txt file
ex:
XB100R1273498
XB100R11934AE
XB100R12134AB
XB100R125349E
XB104R001349T
XB104R001349S
XB110R000349J
XB100R120349V
XB100R12634A6
XB100R14534AD
XB100R12034AA

>You want the patch installed, and the machine name outputted to a file (as a log), right? In which case; what format do >you want it in? (Or aren't you bothered?), e.g:

Like you have it, is fine.


CMILLERAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DrWarezzCommented:
Okay.. I shall get to work now :-)

[r.D]
0
DrWarezzCommented:
Ah, I've got another query:
What is the command to REMOTELY install the patches? :o\

We currently have it like so:

KBXXXXX.exe -Q -Z

How is the machine name to install it on specified?

ta,
[r.D]
0
CMILLERAuthor Commented:
I was going to use psexec.exe on the *.cmd files.

Is that what you mean
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

DrWarezzCommented:
Well, is that the program that you will use to remotely install the Patches?

For Example:

Let's say that you use PSINFO to scan a machine called 'machine1'. You find that it needs the patch 'KB12345.exe' installed. What command would you use to install that patch on that specific machine, remotely?

Because, you're installing all the patches (necessary) on all the machines, remotely, from the one machine, right? So, how do you specify in the code, which machine to install that particular patch on?? If PSEXEC is the program that you'll use for that, what is the Syntax of the command?? (Perhaps type 'PSEXEC /?' and post the results here for me to look at..?).

ta,
[r.D]

Oh, and sorry about the delay. :-)
0
CMILLERAuthor Commented:
No problem,

Its going to be Friday before I get back with you, somethings come up.
0
LongbowCommented:
You can use Microsoft SUS in order to install patches in your network :
http://www.microsoft.com/windowsserversystem/sus/default.mspx
0
CMILLERAuthor Commented:
I am already using SUS, the problem is that it doesnt get updated that often, and where I work,
when security updates come out I have to have them deployed within 24 hours.
0
DrWarezzCommented:
Hey Chris... What is the code to install the patches remotely??

So far, I've coded the following:

:-----8<------------------------------------- FileName.bat -----------------------------------------------:
@ECHO OFF
TITLE Remote Patch Installer
   
   PUSHD %CD%

:** Declare Variables:
   SET MachineFile="c:\directory\MachineNames.txt"
   SET PSINFO="c:\directory\PSINFO.exe"
   SET HotfixDir=c:\patch
   SET HotfixList="c:\directory\Hotfixes.txt"
   FOR %%I in (%0) do SET ThisFile=%%~nI
   

:////////////////////////////////////////////////////////////////////////////////////////////////////
:** Output all available patches to file:
   ECHO. > %HotfixList%
   FOR %%F in (%HotfixDir%\*.exe) do @ECHO %%~nF >>%HotfixList%
   

:////////////////////////////////////////////////////////////////////////////////////////////////////
:** Output Program info:
   ECHO.
   ECHO.
   ECHO %ThisFile% v1.0 - Remote patch installation
   ECHO Copyright (C) %DATE:~-4% Chris Miller ^& Rob Darkins
   ECHO.
   ECHO.
   

:////////////////////////////////////////////////////////////////////////////////////////////////////
:** Verify that machine names file exists:
:MachineFileExist
   
   ECHO Locating Machine List File ...
   
   IF NOT EXIST %MachineFile% (
      ECHO.
      ECHO Cannot locate Machine List File.
      ECHO [Missing File: %MachineFile%]
      ECHO.
      SET /P MachineFile="Please Specify the correct file: "
     
      GOTO :MachineFileExist
   )
   
   ECHO.
   ECHO Located.
   

:////////////////////////////////////////////////////////////////////////////////////////////////////
:** Read the file:
   
   ECHO.
   ECHO Reading machine names ...
   
   FOR /F "tokens=* delims=" %%M in (%MachineFile%) do call :CheckPatches "%%M"
   
   POPD
   
   SET count=4
   :ExitLoop
   ECHO.
   ECHO All Machines have been processed.
   ECHO.
   ECHO [The program will exit in %count% seconds...]
   
   :** Verify that the count is not 0 yet, in which case, EXIT the batch file:
      IF %count% LEQ 0 DEL PATCH.TEMP & EXIT /B
   
   :** Decrement the Seconds Count:
      SET /a count-=1
   
   :** Pause for approximately 1 (rather long) second:
      PING -N 2 LOCALHOST >>NUL
   
   :** Loop back:
      GOTO :ExitLoop
   

:////////////////////////////////////////////////////////////////////////////////////////////////////
:** For every machines passed here as an argument, check for patches that aren't
:     installed on it. Then for every patch not installed, install it remotely:
:CheckPatches
   SET MachineTemp=%~1
   
   :** Output the status:
      ECHO.
      ECHO Checking installed patches on machine: %MachineTemp% ...
      ECHO.
   
   :** Output installed patches on machine to a temp file:
      %PSINFO% -H \\%MachineTemp% > PATCH.TEMP
     
   :** Read all hotfixes in the Hotfix File, if they aren't installed, install them:
      FOR /F "tokens=* delims=" %%H in (%HotfixList%) do call :CheckHotfix "%MachineTemp%" "%%H"
   
   :** Return so that the next machine can be processed:
      EXIT /B
   

:////////////////////////////////////////////////////////////////////////////////////////////////////
:** Check that the hotfix has been installed, if not, install it:
:CheckHotfix
   
   SET MachineCheck=%~1
   SET HotfixToCheck=%~2
   
   FIND /I "%HotfixToCheck%" PATCH.TEMP >>NUL
   SET FLAG=%ERRORLEVEL%
   
   :** Install the patch if not already:
      IF %FLAG% NEQ 0 CALL :INSTALL "%MachineCheck%" "%HotfixToCheck%"
   
   :** Return:
      EXIT /B
   

:////////////////////////////////////////////////////////////////////////////////////////////////////
:INSTALL
   
   SET MachineInstall=%~1
   SET PatchInstall=%~2.exe
   
   :** Install the patch on the machine:
      :** CHANGE ME!
          ECHO.
          ECHO Install Patch: %PatchInstall%
          ECHO Machine:      %MachineInstall%
   
   :** Return:
      EXIT /B
   
:-----8<------------------------------------- FileName.bat -----------------------------------------------:

However, The lines:

      :** CHANGE ME!
          ECHO.
          ECHO Install Patch: %PatchInstall%
          ECHO Machine:      %MachineInstall%

(near the bottom of the code), needs to be changed to the command to actually install the patch. You can use the variables:

%MachineInstall%  and  %PatchInstall% in the command.

I haven't tested it, obviously, because I don't have PSINFO, etc.. nore the same network setup.. But, there it is so far, let me know what you think... and if there are any bugs, and if you need help adding the install command.

gL,
[r.D]
0
CMILLERAuthor Commented:
ok, thanks

I will try this out today
0
CMILLERAuthor Commented:
I was goind to use psexec.exe to install

http://www.sysinternals.com/ntw2k/freeware/psexec.shtml
0
DrWarezzCommented:
Okay; I'll finish the batch file now, and let you know when I'm done :-)

[r.D]
0
DrWarezzCommented:
Here, once again, I haven't tested it (because I don't have the same network setup, etc, etc), but give this a go:


:-----8<--------------------------------------- FileName.cmd ----------------------------------------------------:
@ECHO OFF
TITLE Remote Patch Installer
   
    PUSHD %CD%
    SETLOCAL ENABLEDELAYEDEXPANSION
   
   
:** Declare variables:
   
    SET MachineFile=c:\directory\MachineNames.txt
    SET PSINFO=c:\directory\PSINFO.exe
    SET PSEXEC=c:\directory\PSEXEC.exe
    SET HotfixDir=c:\patch
    SET HotfixList=hotfixes.temp
    SET LogFile=hotfixes.log
   
    FOR %%I IN (%0) DO SET ThisFile=%%~nI
   
   
:** Output all patches in directory to the Patch file:
   
    ECHO. > %HotfixList%
    FOR %%F IN (%HotfixDir%\*.exe) DO @ECHO %%~nF >>%HotfixList%
   
   
:** Output Program info:
   
    ECHO.
    ECHO.
    ECHO %ThisFile% v1.0 - Remote patch installation
    ECHO Copyright (C) %DATE:~-4% Chris Miller ^& Rob Darkins
    ECHO.
    ECHO
   
   
:** Verify that machine names file exists:
   
:MachineFileExist
   
    ECHO Locating Machine List File ...
   
    IF NOT EXIST "%MachineFile%" (
       ECHO.
       ECHO Cannot locate the file containing the Machine names.
       ECHO [Missing File: %MachineFile%]
       ECHO.
       SET /P MachineFile="Please Specify the correct file: "
       
       GOTO :MachineFileExist
    )
   
    ECHO.
    ECHO Located.
   
   
:** Verify that PSINFO exists:
   
:PSINFOExist
   
    ECHO Locating PSINFO ...
   
    IF NOT EXIST "%PSINFO%" (
       ECHO.
       ECHO Cannot locate PSINFO.
       ECHO [Missing File: %PSINFO%]
       ECHO.
       SET /P PSINFO="Please Specify the correct file: "
       
       GOTO :PSINFOExist
    )
   
    ECHO.
    ECHO Located.
   
   
:** Verify that HotfixDir exists:
   
:HotfixDirExist
   
    ECHO Locating HotfixDir List File ...
   
    IF NOT EXIST "%HotfixDir%" (
       ECHO.
       ECHO Cannot locate HotfixDir.
       ECHO [Missing Directory: %PSEXEC%]
       ECHO.
       SET /P HotfixDir="Please Specify the correct directory: "
       
       GOTO :HotfixDirExist
    )
   
    ECHO.
    ECHO Located.
   
   
:** Process ALL Machine names:
   
    FOR /F "tokens=* delims=" %%M IN (%MachineFile%) DO CALL :IF_EXIST "%%M"
   
    ECHO.
    ECHO Complete.
   
    PING -n 1 LOCALHOST >>NUL
   
    EXIT /B
   
   
:** Verify that all given machine names exist, if so, then continue to the patch section:
:IF_EXIST
   
    SET Machine1=%~1
   
    ECHO.
    ECHO Locating machine [%Machine1%] ...
   
    PING -n 1 %Machine1% >>NUL
   
    IF %ERRORLEVEL% NEQ 0 (
        ECHO.
        ECHO Machine [%Machine1%] cannot be located.
        ECHO.
        EXIT /B
    )
   
    ECHO.
    ECHO Machine [%Machine1%] has been located.
    ECHO.
   
    CALL :IF_PATCH "%Machine1%"
   
    EXIT /B
   
   
:** Check for patches that have not been installed, then install them:
:IF_PATCH
   
    SET Machine2=%~1
    %PSINFO% -h \\%Machine2% > PsInfo.temp
   
    FOR /F "tokens=* delims=" %%P IN (%HotfixList%) DO CALL :INSTALL "%%P" "%Machine2%"
   
    EXIT /B
   
   
:** Check if the patch has been installed, if not, install it:
:INSTALL
   
    SET Patch1=%~1
    SET Machine3=%~2
   
    ECHO.
    ECHO Checking if patch [%Patch1%] exists on machine [%Machine3%] ...
   
    FOR /F "tokens=* delims=" %%L IN (%LogFile%) DO (
        FOR /F "tokens=2 delims=;" %%A in ("%%L") DO IF /I "%%A"=="%Machine3%" ( IF /I "%%B"=="%Patch1%" EXIT /B )
    )
   
    FIND /I "%Patch1%" PsInfo.temp >>NUL
   
    IF %ERRORLEVEL% NEQ 0 (
        ECHO.
        ECHO Installing patch ...
        ECHO Machine: %Machine3%
        ECHO Patch:     %Patch1%
        ECHO.
        %PSEXEC% \\%Machine3% "%Patch1%.exe"
       
        :** Log Machine and Patch to file:
            ECHO %Machine3%;%Patch1% >>%LogFile%
    )
   
    ECHO.
    ECHO Patch is already installed.
    ECHO.
   
    EXIT /B
   
:-----8<--------------------------------------- FileName.cmd ----------------------------------------------------:

Obviously, you need to change the variables at the start of it.. let me know how it goes :-)

gL,
[r.D]
0
DrWarezzCommented:
Let me just elaborate on the variables near the start of the code:

    SET MachineFile=c:\directory\MachineNames.txt
    SET PSINFO=c:\directory\PSINFO.exe
    SET PSEXEC=c:\directory\PSEXEC.exe
    SET HotfixDir=c:\patch
    SET HotfixList=hotfixes.temp
    SET LogFile=hotfixes.log


MachineFile
--------------
This file is what has the list of all the Machine Names, to remotely install necessary patches on.

PSINFO
--------------
Where PSINFO.exe is located.

PSEXEC
--------------
Where PSEXEC.exe is located.

HotfixDir
--------------
Where all the patches are installed, on your machine.

HotfixList
--------------
A list of all located patches (from inside the %HotfixDir% directory) that are located will be outputted to the %HotfixList% file.

LogFile
--------------
The file to create a log of all installed patches on all machines.


I hope that helps :-)
[r.D]
0
CMILLERAuthor Commented:
I will try it out today
0
CMILLERAuthor Commented:
Here is what I got, not to bad the first through.

>PsExec could not start Q828026 .exe on XB100R11934AE:
>The system cannot find the file specified.
It looks like a space, I could not find where to take it out.
Also, I dont know if you remember that are switches that needs to be put in.

The problem is that with M$ hotfixes all the switches are different.
( something i didnt realize until now )

I could not find it in the code, is this something I could modify
as I find out what switches goes with each patch.

Or have I messed you up completely.


************************************
Locating machine [XB100R11934AE ] ...

Machine [XB100R11934AE ] has been located.


PsInfo v1.63 - Local and remote system information viewer
Copyright (C) 2001-2004 Mark Russinovich
Sysinternals - www.sysinternals.com


Checking if patch [ ] exists on machine [XB100R11934AE ] ...

Patch is already installed.


Checking if patch [Q323255 ] exists on machine [XB100R11934AE ] ...

Patch is already installed.


Checking if patch [Q828026 ] exists on machine [XB100R11934AE ] ...

Installing patch ...
Machine: XB100R11934AE
Patch:     Q828026


PsExec v1.55 - Execute processes remotely
Copyright (C) 2001-2004 Mark Russinovich
Sysinternals - www.sysinternals.com


PsExec could not start Q828026 .exe on XB100R11934AE:
The system cannot find the file specified.

Patch is already installed.


Locating machine [XB100R12134AB ] ...

Machine [XB100R12134AB ] has been located.


PsInfo v1.63 - Local and remote system information viewer
Copyright (C) 2001-2004 Mark Russinovich
Sysinternals - www.sysinternals.com

Querying information for XB100R12134AB...^CTerminate batch job (Y/N)? y

C:\patch>
0
DrWarezzCommented:
Okay.. I have an idea.. I'll get back to you in about 30 mins.. ;-)
0
DrWarezzCommented:
Okay, firstly, let's see how much of a difference this will make:

(by removing the spaces [which are occuring to a slight bug in the code])..  Locate these lines:


:** Check if the patch has been installed, if not, install it:
:INSTALL
   
    SET Patch1=%~1
    SET Machine3=%~2
   
    ECHO.
    ECHO Checking if patch [%Patch1%] exists on machine [%Machine3%] ...
   
    FOR /F "tokens=* delims=" %%L IN (%LogFile%) DO (
        FOR /F "tokens=2 delims=;" %%A in ("%%L") DO IF /I "%%A"=="%Machine3%" ( IF /I "%%B"=="%Patch1%" EXIT /B )
    )


And replace them with these:


:** Check if the patch has been installed, if not, install it:
:INSTALL
   
    SET Patch1=%~1
    SET Machine3=%~2
    SET Patch1=%Patch1: =%
   
    ECHO.
    ECHO Checking if patch [%Patch1%] exists on machine [%Machine3%] ...
   
    FOR /F "tokens=* delims=" %%L IN (%LogFile%) DO (
        FOR /F "tokens=2 delims=;" %%A in ("%%L") DO IF /I "%%A"=="%Machine3%" ( IF /I "%%B"=="%Patch1%" EXIT /B )
    )


Then save it, and let me know what difference it makes... we'll come to the switches in a few mins..

[r.D]
0
DrWarezzCommented:
>"I could not find it in the code, is this something I could modify as I find out what switches goes with each patch."

Sure.. if you create a file, with the following format (just replace it with the appropriate data):


PatchCode;switch1;switch2;

So, an example of that format in the file would be:

KB12345;z;q

(I'll add the hyphens (-) to the switches in the code.
:-)

[r.D]
0
DrWarezzCommented:
btw; you can add as many switches as you want, it don't have to be just two.. you could have something like this if you want:

KB12345;a;b;r;s;z;t;v


Note: add each patch and all the switches (like the example above) on seperate lines in the file.
0
DrWarezzCommented:
Okay.. I've spotted a few more bugs in the code.. I've altered them, but I will add the code to enable dynamic switches before I post it all here, so give me a short while :-)

[r.D]
0
CMILLERAuthor Commented:
cool
0
DrWarezzCommented:
Actually, for the file with the switches in, could you put it like this:
Ex:

KB12345.exe -q -z


Would you mind doing that?? It would save alot of time for myself, and limit bugs, I'm sure ;-)

btw; I'm nearly done with the batch file....

ta,
[r.D]
0
CMILLERAuthor Commented:
yea, thats fine
0
DrWarezzCommented:
Okay, let me know how this one performs:

:***********************************************************************************:
@ECHO OFF
TITLE Remote Patch Installer
   
    PUSHD %CD%
    SETLOCAL ENABLEDELAYEDEXPANSION
   
   
:** Declare variables:
   
    SET MachineFile=c:\directory\MachineNames.txt
    SET PSINFO=c:\directory\PSINFO.exe
    SET PSEXEC=c:\directory\PSEXEC.exe
    SET HotfixDir=c:\patch
    SET HotfixList=hotfixes.temp
    SET LogFile=hotfixes.log
    SET SwitchFile=switches.txt
   
    FOR %%I IN (%0) DO SET ThisFile=%%~nI
   
   
:** Output all patches in directory to the Patch file:
   
    DEL %HotfixList% /q >>NUL
    FOR %%F IN (%HotfixDir%\*.exe) DO @ECHO %%~nF >>%HotfixList%
   
   
:** Output Program info:
   
    ECHO.
    ECHO.
    ECHO %ThisFile% v1.0 - Remote patch installation
    ECHO Copyright (C) %DATE:~-4% Chris Miller ^& Rob Darkins
    ECHO.
    ECHO
   
   
:** Verify that the SwitchFile exists:
   
:SwitchFileExist
   
    ECHO Locating SwitchFile ...
   
    IF NOT EXIST "%SwitchFile%" (
       ECHO.
       ECHO Cannot locate the SwitchFile.
       ECHO [Missing File: %SwitchFile%]
       ECHO.
       SET /P MachineFile="Please Specify the correct file: "
       
       GOTO :SwitchFileExist
    )
   
    ECHO.
    ECHO Located.
   
   
:** Verify that machine names file exists:
   
:MachineFileExist
   
    ECHO Locating Machine List File ...
   
    IF NOT EXIST "%MachineFile%" (
       ECHO.
       ECHO Cannot locate the file containing the Machine names.
       ECHO [Missing File: %MachineFile%]
       ECHO.
       SET /P MachineFile="Please Specify the correct file: "
       
       GOTO :MachineFileExist
    )
   
    ECHO.
    ECHO Located.
   
   
:** Verify that PSINFO exists:
   
:PSINFOExist
   
    ECHO Locating PSINFO ...
   
    IF NOT EXIST "%PSINFO%" (
       ECHO.
       ECHO Cannot locate PSINFO.
       ECHO [Missing File: %PSINFO%]
       ECHO.
       SET /P PSINFO="Please Specify the correct file: "
       
       GOTO :PSINFOExist
    )
   
    ECHO.
    ECHO Located.
   
   
:** Verify that HotfixDir exists:
   
:HotfixDirExist
   
    ECHO Locating HotfixDir List File ...
   
    IF NOT EXIST "%HotfixDir%" (
       ECHO.
       ECHO Cannot locate HotfixDir.
       ECHO [Missing Directory: %PSEXEC%]
       ECHO.
       SET /P HotfixDir="Please Specify the correct directory: "
       
       GOTO :HotfixDirExist
    )
   
    ECHO.
    ECHO Located.
   
   
:** Process ALL Machine names:
   
    FOR /F "tokens=* delims=" %%M IN (%MachineFile%) DO CALL :IF_EXIST "%%M"
   
    ECHO.
    ECHO Complete.
   
    PING -n 1 LOCALHOST >>NUL
   
    EXIT /B
   
   
:** Verify that all given machine names exist, if so, then continue to the patch section:
:IF_EXIST
   
    SET Machine1=%~1
   
    ECHO.
    ECHO Locating machine [%Machine1%] ...
   
    PING -n 1 %Machine1% >>NUL
   
    IF %ERRORLEVEL% NEQ 0 (
        ECHO.
        ECHO Machine [%Machine1%] cannot be located.
        ECHO.
        EXIT /B
    )
   
    ECHO.
    ECHO Machine [%Machine1%] has been located.
    ECHO.
   
    CALL :IF_PATCH "%Machine1%"
   
    EXIT /B
   
   
:** Check for patches that have not been installed, then install them:
:IF_PATCH
   
    SET Machine2=%~1
    %PSINFO% -h \\%Machine2% > PsInfo.temp
   
    FOR /F "tokens=* delims=" %%P IN (%HotfixList%) DO CALL :INSTALL "%%P" "%Machine2%"
   
    EXIT /B
   
   
:** Check if the patch has been installed, if not, install it:
:INSTALL
   
    SET Patch1=%~1
    SET Patch1=%Patch1: =%
    SET Machine3=%~2
   
    ECHO.
    ECHO Checking if patch [%Patch1%] exists on machine [%Machine3%] ...
   
    FOR /F "tokens=* delims=" %%L IN (%LogFile%) DO (
        FOR /F "tokens=2 delims=;" %%A in ("%%L") DO IF /I "%%A"=="%Machine3%" ( IF /I "%%B"=="%Patch1%" EXIT /B )
    )
   
    :** Extract the necessary switches for this patch, from the SwitchFile:
        SET SWITCHES=
        FOR /F "tokens=* delims=" %%S in (%SwitchFile%) do CALL :SWITCHES "%%S" "%Patch1%"
   
        IF /I "%SWITCHES%"=="" (
            ECHO.
            ECHO An unexpected error has occured: A switch for the patch has not been retrieved.
            ECHO.
            EXIT /B
        )
       
    FIND /I "%Patch1%" PsInfo.temp >>NUL
   
    IF %ERRORLEVEL% NEQ 0 (
        ECHO.
        ECHO Installing patch ...
        ECHO Machine: %Machine3%
        ECHO Patch:     %Patch1%
        ECHO.
       
        %PSEXEC% \\%Machine3% "%HotfixDir%\%SWITCHES%"
       
        :** Log Machine and Patch to file:
            ECHO %Machine3%;%Patch1% >>%LogFile%
    )
   
    ECHO.
    ECHO Patch is already installed.
    ECHO.
   
    EXIT /B
   
   
:** Create the switches:
:SWITCHES
   
    SET Pass1=%~1
    SET Code1=%~2
   
    IF /I "%Pass1:~0,5%"=="%Code1:~0,5%" SET SWITCHES=%Pass1%
   
    EXIT /B
   
:***********************************************************************************:

Just alter the variable here:
  SET SwitchFile=switches.txt

(which is near the start of the batch file) to wherever the file is, with the Patchname & switches (as specified above).

gL,
[r.D]
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CMILLERAuthor Commented:
I thought everything was ok, but if you notice this line

PsExec could not start c:\patch\q828026.exe /quiet /norestart /o /n on XB100R118349Z:
The system cannot find the path specified.

The way you have it, it is going to the \\machinename, but I think the error is
that I dont have c:\patch\q828026.exe on the \\machinename.

If this looks correct to you, I can robocopy the files to all machines


********************************************
C:\patch>patchinstall.cmd

patchinstall v1.0 - Remote patch installation
Copyright (C) 2004 Chris Miller & Rob Darkins

ECHO is off.
Locating SwitchFile ...

Located.
Locating Machine List File ...

Located.
Locating PSINFO ...

Located.
Locating HotfixDir List File ...

Located.

Locating machine [XB100R118349Z] ...

Machine [XB100R118349Z] has been located.


PsInfo v1.63 - Local and remote system information viewer
Copyright (C) 2001-2004 Mark Russinovich
Sysinternals - www.sysinternals.com


Checking if patch [KB840987] exists on machine [XB100R118349Z] ...

Patch is already installed.


Checking if patch [Q323255] exists on machine [XB100R118349Z] ...

Patch is already installed.


Checking if patch [Q828026] exists on machine [XB100R118349Z] ...

Installing patch ...
Machine: XB100R118349Z
Patch:     Q828026


PsExec v1.55 - Execute processes remotely
Copyright (C) 2001-2004 Mark Russinovich
Sysinternals - www.sysinternals.com


PsExec could not start c:\patch\q828026.exe /quiet /norestart /o /n on XB100R118349Z:
The system cannot find the path specified.

Patch is already installed.


Complete.

C:\patch>




0
CMILLERAuthor Commented:
I wont be back in the office until Monday,
I will work on it then.

Have a good weekend.

Thanks
-Chris
0
DrWarezzCommented:
Sure thing. Hope you have a good weekend also.

Yeah, perhaps the patch needs to be copied to their machine? If my memory serves me; you should be able to add the /c switch to the PSEXEC command, to copy it to the remote machine.. You may want to do a little testing with the /c switch (or any other method) before we test it with the batch file..

To add the /c switch to PSEXEC, locate the following line (near the top of the batch file):

    SET PSEXEC=c:\directory\PSEXEC.exe

and add the /c switch to the end of that line, like so:

    SET PSEXEC=c:\directory\PSEXEC.exe /c

gL,
[r.D]
0
LongbowCommented:
Another way to manage patches on a network.
You can scan ranges of IP and dispatch the patches.

Microsoft Baseline Security Analyzer (MBSA) Management Pack Guide :
http://www.microsoft.com/downloads/details.aspx?FamilyID=57f9a6a3-35a4-40c8-a5f3-9d598f430366&displaylang=en
Microsoft Baseline Security Analyzer V1.2.1 :
http://www.microsoft.com/technet/security/tools/mbsahome.mspx
0
CMILLERAuthor Commented:
Rob,

Just wanted to let you know I am still testing, all looks good though.

-Chris
0
DrWarezzCommented:
Excellent -- Keep me informed :-)

[r.D]
0
LongbowCommented:
This one is new :

Evaluate Microsoft Windows Update Services Now
http://www.microsoft.com/windowsserversystem/wus/default.mspx

Microsoft Windows Update Services Frequently Asked Questions
http://www.microsoft.com/windowsserversystem/wus/faqs.mspx
0
CMILLERAuthor Commented:
Rob,

Its all good.

Thanks, for taking the time to work through this
with me.

I have learned alot about scripting, with this project.

-Chris
0
CMILLERAuthor Commented:
Longbow,

Thanks, for the info
0
DrWarezzCommented:
Glad I could help, Chris -- and thanks for the points :-)

[r.D]
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft DOS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.