Page 1 of 1 1
Topic Options
#44066 - 2003-08-14 04:29 PM IF ELSE GOTO problems
indycolt Offline
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
#44067 - 2003-08-14 04:38 PM Re: IF ELSE GOTO problems
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Don't use GOTO. Rearrange your IF ELSE ENDIF structure instead.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#44068 - 2003-08-14 04:38 PM Re: IF ELSE GOTO problems
Radimus Moderator Offline
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 ]
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#44069 - 2003-08-14 04:45 PM Re: IF ELSE GOTO problems
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
NOT does not exist on all versions of KiX.
Are you sure that $iever = "6.0.2800.1106"?

Maybe $iever = "6.00.2800.1106"
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#44070 - 2003-08-14 04:47 PM Re: IF ELSE GOTO problems
indycolt Offline
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 Offline
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'
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#44072 - 2003-08-14 04:51 PM Re: IF ELSE GOTO problems
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
See reply before this [Roll Eyes]
_________________________



Top
#44073 - 2003-08-14 04:52 PM Re: IF ELSE GOTO problems
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Reread my reply and please don't double post.

Where's a moderator when you need one?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#44074 - 2003-08-14 04:55 PM Re: IF ELSE GOTO problems
Allen Administrator Online   shocked
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 Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
hmmm ...

I'd like to take back my statement about the not construct and accuse the weather here for that nonense [Mad] [Embarrassed] [Mad] [Embarrassed]
_________________________



Top
#44076 - 2003-08-14 05:02 PM Re: IF ELSE GOTO problems
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
On my system, the code:
$iever = GETFILEVERSION($iexplore

returns:
6.00.2800.1106
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#44077 - 2003-08-14 05:06 PM Re: IF ELSE GOTO problems
indycolt Offline
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
#44078 - 2003-08-14 05:09 PM Re: IF ELSE GOTO problems
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Well, I'm pretty sure it does not return that value. [Wink]

A string maybe...
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#44079 - 2003-08-14 05:40 PM Re: IF ELSE GOTO problems
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
I would triple check what is value is in $iever. If I run

code:
getfileversion("C:\Program Files\Internet Explorer\iexplore.exe")

I get

quote:

6.00.2800.1106 (xpsp1.020828-1920)

_________________________
Eric

Top
#44080 - 2003-08-14 05:48 PM Re: IF ELSE GOTO problems
indycolt Offline
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
#44081 - 2003-08-14 05:49 PM Re: IF ELSE GOTO problems
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
What is in your BAT file? If it is only one line, then you could just RUN "path/file.exe", for example:

run 'ie6setup.exe /Q:A /C:"ie6wzd /S:""#e"" /Q:C"'

Top
#44082 - 2003-08-14 05:52 PM Re: IF ELSE GOTO problems
Radimus Moderator Offline
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

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#44083 - 2003-08-14 08:41 PM Re: IF ELSE GOTO problems
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You could also use CompareVersions() - Compares two multi-segment version strings to compare file versions.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 781 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.072 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org