john7033
(Fresh Scripter)
2004-02-04 04:58 PM
How to select "ok" in windows dialog

I have a script to check the registry for an IE patch. If the value isn't found, the script tries to execute each of three patches. (We have three different win platforms)

Instead of checking for the IE version and patch level, I just run each of the patches and the correct one will install while the incorrect ones pop up a message box informing the user that this patch is the wrong one. I want to have the script send a crlf to the message box to simulate the user clicking on the "ok" button, but it doesn't work. How can I send this crlf to the message box?

--- script ---
;########################################################################
; create the patch directory and copy patches to the directory


$RETURN = CHR(13) + CHR(10)
if exist('c:\patches')=0
md 'c:\patches'
endif

SHELL "CMD.EXE /C COPY P:\Admin\patches\IE6sp1.exe C:\patches"
SHELL "CMD.EXE /C COPY P:\Admin\patches\IE6.exe C:\patches"
SHELL "CMD.EXE /C COPY P:\Admin\patches\IE_5.5.exe C:\patches"


; check the registry for the presence of this patch
$patch = ReadValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{peddbec60-89cb-44ef-8291-0850fd28ff6a}","ComponentID")
If @ERROR = O
" $patch found in registry"
$RETURN
Endif

if $patch = Q832894
"Found. No further action needed."
else

RUN C:\patches\IE_5.5.exe
$RETURN
sleep 3
RUN C:\patches\IE6.exe
$RETURN
sleep 3
RUN C:\patches\IE6sp1.exe
$RETURN
sleep 3

Endif



Sealeopard
(KiX Master)
2004-02-04 05:01 PM
Re: How to select "ok" in windows dialog

Run the patches in silent mode by specifying the appropriate switch e.g. /q.