JimC Posted August 6, 2007 Posted August 6, 2007 I would like to read a directory of hotfixes assign to array then execute the hotfixes with /integrate: /passive /norestart /overwriteoem options I would also like to display a message of x number of hotfixes to run to notify of how many hofixes are left to integrate. Any idea ? #include <array.au3> arr1 = _filelistto array($hfdir) if @ error = -1 then exitloop _arraysort($arr1, 0,1 )
JimC Posted August 6, 2007 Author Posted August 6, 2007 GUICtrlSetState($but_hot_intergrate, $gui_disable) ; Start Button $arr1= _FileListToArray($hfdir) _ArraySort($arr1, 0, 1) for $c = 1 to ubound($arr1, 1) -1 RunWait($arr1[$c] & ' /integrate:' & $xpcd & ' /passive /norestart /overwriteoem') $message = GUICtrlCreateLabel('Integrating: ' & $arr1[$c] , 10, 405, 570, 20) sleep(1000) GUICtrlDelete($message) Next $message = GUICtrlCreateLabel(' Hotfix Integration Complete. ', 10, 405, 570, 20) Can anyone offer a suggestion on the runwait statement? I am reading the hotfixes into an array passing the /integrate switch which needs a destination directory, but I also need to pass /passive /norestart /overwriteoem switches as well. IT bombs out because of what I am trying to pass after the second & Thanks for any assistance.
jefhal Posted August 6, 2007 Posted August 6, 2007 Where do you define what's in $xpcd? Do you need a space after "/integrate:" ? Have you tried using @comspec to run the command? Or is there a special Windows command that is needed to run a hotfix program? Add a msgbox line that tests out the expansion of your RunWait statement. Then try to run that expanded statement in a dos box. e.g. $var = $arr1[$c] & ' /integrate:' & $xpcd & ' /passive /norestart /overwriteoem' msgbox(1,"",$var) Can anyone offer a suggestion on the runwait statement? ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
JimC Posted August 6, 2007 Author Posted August 6, 2007 I am getting an error message that it cant run external command. I think it is having a problem with the switches I am trying to throw at it. I also tried giving it a working directory of $hfdir which is where the hotfixes are housed.
PsaltyDS Posted August 7, 2007 Posted August 7, 2007 I am getting an error message that it cant run external command. I think it is having a problem with the switches I am trying to throw at it. I also tried giving it a working directory of $hfdir which is where the hotfixes are housed. You only get the file name, not the full path in _FileListToArray(), so you need to reassemble the full path with something like (also displays command line to console for easier troubleshooting): $sExtCmd = $hfdir & "\" & $arr1[$c] & ' /integrate:' & $xpcd & ' /passive /norestart /overwriteoem' ConsoleWrite("Debug: $sExtCmd = " & $sExtCmd & @LF) $RET = RunWait($sExtCmd, $hfdir) ConsoleWrite("Debug: $RET = " & $RET & @LF) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
JimC Posted August 7, 2007 Author Posted August 7, 2007 Here is what I did , but I had to change Group policy on file extension to stop Xp sp2 from asking to run each file. Your option would have avoided that. I will test. Thank you very much for your suggestion. $xpcd= "c:\testxp"; dont forget to delete this $workdir = $hfdir &'\' $parameters = '/integrate:' & $xpcd & ' /passive /norestart /overwriteoem' GUICtrlSetState($but_hot_intergrate, $gui_disable) ; Start Button $arr1= _FileListToArray($hfdir) _ArraySort($arr1, 0, 1) for $c = 1 to ubound($arr1, 1) -1 $var= $arr1[$c] $message = GUICtrlCreateLabel('Integrating: ' & $arr1[$c] , 10, 405, 570, 20) ShellExecuteWait($var, $parameters,$hfdir) sleep(1000) GUICtrlDelete($message) Next $message = GUICtrlCreateLabel(' Hotfix Integration Complete. ', 10, 405, 570, 20)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now