#44066 - 2003-08-14 04:29 PM
IF ELSE GOTO problems
|
indycolt
Fresh Scripter
Registered: 2003-08-14
Posts: 5
|
Could someone please tell me what I'm doing wrong? The below script always installs IE6 and I only want it to install if the version number is not 6.0.2800.1106
Thanks
$regkey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\iexplore.exe" $iexplore = READVALUE($regkey,"") $iever = GETFILEVERSION($iexplore)
?$iever
IF $iever = "6.0.2800.1106" GOTO END ELSE GOTO IEINST ENDIF
:IEINST ; *IE6 Install* ? "** Processing.... Please Wait **" RUN \\server\SYSVOL\home.com\scripts\ie6setup.bat
:END exit
|
|
Top
|
|
|
|
#44068 - 2003-08-14 04:38 PM
Re: IF ELSE GOTO problems
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
IF not $iever = "6.0.2800.1106" RUN "\\server\SYSVOL\home.com\scripts\ie6setup.bat" endif [ 14. August 2003, 16:42: Message edited by: Radimus ]
|
|
Top
|
|
|
|
#44070 - 2003-08-14 04:47 PM
Re: IF ELSE GOTO problems
|
indycolt
Fresh Scripter
Registered: 2003-08-14
Posts: 5
|
Thanks for the quick reply!
But I'm still stuck in a loop! IE keeps installing. Here is the updated script.
$regkey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\iexplore.exe" $iexplore = READVALUE($regkey,"") $iever = GETFILEVERSION($iexplore)
?$iever
IF not $iever = "6.0.2800.1106" RUN \\olympus1\SYSVOL\home.dynetech.com\scripts\ie6setup.bat ENDIF
exit
|
|
Top
|
|
|
|
#44071 - 2003-08-14 04:50 PM
Re: IF ELSE GOTO problems
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
from my logon script: $ier =readvalue("HKLM\Software\Microsoft\Internet Explorer", "Version")
; ************************** Internet Explorer 6 Service Pack 1 ************************************ if $os="Win2k" and $ier="6.0.2600.0000" if updateapp("InternetExplorer6SP1",3)="yes"
; ************************** Internet Explorer 6 Security Rollup 818529 - June 2003 ************************************ if $os='Win2k' and $ier='6.0.2800.1106'
|
|
Top
|
|
|
|
#44074 - 2003-08-14 04:55 PM
Re: IF ELSE GOTO problems
|
Allen
KiX Supporter
   
Registered: 2003-04-19
Posts: 4567
Loc: USA
|
quote: RUN \\olympus1\SYSVOL\home.dynetech.com\scripts\ie6setup.bat
You might try changing the above line to:
code:
shell "\\olympus1\SYSVOL\home.dynetech.com\scripts\ie6setup.bat"
|
|
Top
|
|
|
|
#44075 - 2003-08-14 04:59 PM
Re: IF ELSE GOTO problems
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
|
Top
|
|
|
|
#44077 - 2003-08-14 05:06 PM
Re: IF ELSE GOTO problems
|
indycolt
Fresh Scripter
Registered: 2003-08-14
Posts: 5
|
Thanks guys!
$iver returns the value of 6.0.2800.1106.
I also tried to change the RUN to SHELL, but no luck. LOOP LOOP LOOP, I'm going crazy.
|
|
Top
|
|
|
|
#44080 - 2003-08-14 05:48 PM
Re: IF ELSE GOTO problems
|
indycolt
Fresh Scripter
Registered: 2003-08-14
Posts: 5
|
On a XP box I get 6.00.2800.1106 (xpsp1.020828-1920) On a 2k box I get 6.0.2800.1106
I only want to run this on an 2k box
Thanks
|
|
Top
|
|
|
|
#44082 - 2003-08-14 05:52 PM
Re: IF ELSE GOTO problems
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
code:
; ************************** Internet Explorer 6 Service Pack 1 ************************************ if $os="Win2k" and $ier="6.0.2600.0000" if updateapp("InternetExplorer6SP1",3)="yes" $=sendmessage(@wksta," The computer will automatically restart when complete.@CRLF This will take about 5-10 minutes.") $=Writeprofilestring("$logon\inventory\Install.log","IE6SP1","@wksta","@date") run '$setup\IE6SP1\ie6setup.exe /q' $m= "A CRITICAL Update is NOW taking place. Please do not open any programs until your system reboots.", "The Upgrade is running. Please do not open any programs. This will take about 10-15 minutes.", "The Upgrade will be complete in about 15 minutes and your computer will restart on it's own.", "You can stop clicking now." while ubound($m)>0 for each $message in $m $=Messagebox($message, "Message from MIS",65536) sleep 2 next loop quit endif endif ; ************************** Internet Explorer 6 Security Rollup 818529 - June 2003 ************************************ if $os='Win2k' and $ier='6.0.2800.1106' if not Readvalue("HKLM\Software\Microsoft\Active Setup\Installed Components\{f5de1b93-9d38-416b-b09e-aa85a8e84309}","ComponentID")='Q818529' if updateapp('IE.Security.Rollup.June.2003',3)='yes' shell '$setup\IEQ818529\q818529.exe /q /r:n' endif endif endif
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 781 anonymous users online.
|
|
|