Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hotfix command line

Status
Not open for further replies.

bn2hunt

MIS
May 15, 2003
203
US
Does anyone know how to enumerate the command line properties of a hotfix(kb99999 /?) and capture that info for use in a script? I tried using the following code but since it outputs to a windows it doesn't pick anything up.

Any ideas?

set fs = CreateObject("Scripting.FileSystemObject")
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.EXEC("D:\xp\update\KB824146.exe /?")

Do While oExec.Status = 0
WScript.Sleep 100
Loop
Do While oExec.StdOut.AtEndOfStream <> True
retstring = oExec.StdOut.ReadLine
MSGBOX retstring
Loop
 
r sugar that sucks as it has another file dependance which you will then have to read in, i hate inefficient solutions...they are ugly but sometimes required.

in this case i see no reason why the .exec command will work. i used it once for reading the output of dfsutil.exe to see which server a dfs share was actually connecting to

i can dig out the code if you like?
 
this worked for me,,, i must learn to put all my thought in one thread!!!

'If FSO.FileExists("c:\win\system32\dfsutil.exe") Then
'Dim oExec
'Dim blnSectionFound
'Dim sLine
'Set oExec = WshShell.Exec("c:\win\system32\dfsutil.exe /pktinfo")
'blnSectionFound = False
'Do While Not oExec.StdOut.AtEndOfStream
' sLine = LCase(Trim(oExec.StdOut.ReadLine))
''msgbox sLine
' If sLine = "entry: \fsc.net\dfsroot\software" Then
' blnSectionFound = True
'End If
'If blnSectionFound = True Then
'If Right(sLine, 10) = "( active )" Then
' If InStr(sLine, "[\") > 0 Then
' strDFSServer = Mid(sLine, InStr(sLine, "[\") + 2, Instr(InStr(sLine, "[\") + 2, sLine, "\") - InStr(sLine, "[\") - 2)
' End If
' End If
'End If
'Loop
'Set oExec = Nothing
'Else
''could always try the sname.ini file if the above didnt work
'End If
 
I tried c:\hotfix.exe /? >> c:\hotfix.txt it creats the file but it is blank so I don't think it outputs anything other than a windows with the information in it. ie nothing for oExec.StdOut.ReadLine to capture.


 
sorry,
so when you do a c:\hotfix.exe /? does it display a message box rather than echo'in something in the dos box
what are the command line switches availble?
 
It displays a message box, the command line switches varies between at least 3 sets of different switches depending on which windows hotfix I want to install. So I wanted to check to see which set it is using to build my run command.
 
sounds pretty flash what you are trying ddnwolf!!!! good luck.
i would say you had a few options, try and figure out how to change the defauult behavour of the /? for these exe's i.e change stdout to the console. not sure if any other the other /help etc will help.

if not i can only think of appactivate in vbscript but that wont help you much either

or perhaps MS can supply you with a flat file of a list of what hotfixes are available and what their cmdline params are,,,or you could create one yourself which i guess defeats the object as you have to keep it upto date

sorry i dont think i can be of much help

regards
mrmovie
 
It displays a message box. The command line switches vary depending on which hotfix I want to install. I wanted to be able to see them in the script to create my run command.

DDNWolff
 
Thanks for the help. That was what I was thinking that I may have to create a flat file with the switches in it.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top