Re: different patching syntax



James,

Is your script working now? Is this the whole script as shown on this page.
I want to be able to run the patches without rebooting.
Do I need to make changes to the script or can I use it like it is now?

Please repost your script.

thank you.

"James" wrote:

> i just realised that when i use -q -z parameters, it seems to work for *ALL
> * kinds of hofixes even though i type KB890047.EXE /?, the parameters
> options are /passive /norestart /etc
>
> Does anyone or MVP can confirm with Microsoft ?
>
> I can't check mine because all my machines are fully 100% patched, so the
> installation will stop and ignore and will not proceed to the end.
>
>
>
> "Al Dunbar [MS-MVP]" <alan-no-drub-spam@xxxxxxxxxxx> wrote in message
> news:u1$XyPBNFHA.1948@xxxxxxxxxxxxxxxxxxxxxxx
> >
> > "James" <jkklim@xxxxxxxxxxx> wrote in message
> > news:uSXGAaANFHA.4028@xxxxxxxxxxxxxxxxxxxxxxx
> > > i've wrote a script that reads a directory that contains all patches and
> > run
> > > it automatically. However i realise microsoft has 2 different syntax for
> > > patches. Eg from microsoft exe
> > >
> > > 823559.exe uses -q -z
> > > KB890047.EXE uses /passive /norestart
> > >
> > > When my script runs, it runs the default " /passive /norestart", thus
> most
> > > kbxxx files can be executed. However when it encounters 823559.exe, it
> > > cannot run " /passive /norestart", thus prompting a message which is
> > > equivalent to 823559 /?
> >
> > If the syntax is completely consistent with respect to the filename
> syntax,
> > why not just test for the filename starting with "KB"?
> >
> > > I would like to write a error handling routine that when such prompts
> > 823559
> > > /? appears, i can trap the error number (when i click the ok button),
> and
> > my
> > > script will change its default syntax to "-q -z"
> > >
> > > Here is a sample code i wrote.
> > >
> > > ===============================
> > > 'define standard syntax for microsoft hotfixes
> > > 'eg <hotfix.exe> /passive /norestart
> > > syntax = "/passive /norestart"
> > > filenamex = mypath & "\" & objdict.item(objitem) & " " & syntax
> > >
> > > 'execute each files
> > > wscript.echo "Executing file " & c & " : " & filenamex
> > >
> > > objshell.run ("%comspec% /c " & filenamex) ,0,true
> > >
> > >
> > > if err.number <> 0 then
> > > wscript.echo "Script redoing this patch using another -u -z
> parameters."
> > > new_syntax = " -u -z"
> > > filenamex = mypath & "\" & objdict.item(objitem) & " " & new_syntax
> > > objshell.run("%comspec% /c " & filenamex),0,true
> > > err.clear
> > > end if
> > > ===============================
> >
> > I do not think that the err object will receive any error indicator from
> the
> > program that was run. As far as the .run method goes, if the indicated
> > executable was run, the result would be success, regardless whether it
> > succeeded from your point of view.
> >
> > You *might* be able to trap a return code with:
> >
> > rc = objshell.run ( ("%comspec% /c " & filenamex) ,0,true )
> >
> > however, you would need to know for a certainty that this would ALWAYS
> > return non-zero in the event of getting the wrong parameters. Even if it
> > worked in some cases, I wouldn't think it a safe bet in all cases.
> >
> > Another way to do this would be to trap the output from the executable. If
> > the length of the output is zero, it might be safe to assume that the
> > executable ran successfully, otherwise you would then try with the other
> > parameters.
> >
> > You can trap the output by modifying the %comspec% line to redirect the
> > output, or using the .exec method instead.
> >
> > Alternately, you *could* just run the executable twice, once with each
> style
> > of parameters. You would then just need to feel confident you (or would it
> > be your users?) could ignore the apparent error messages that would be
> > displayed.
> >
> > /Al
> >
> >
>
>
>
.