Page 1 of 1 1
Topic Options
#44062 - 2003-08-14 04:28 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
#44063 - 2003-08-14 04:39 PM Re: IF ELSE GOTO problems
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
the string extract is correct ...

you may want to get rid of this goto stuff though by specifying a clear condition like

code:
if $iever = "6.0.2800.1106"
quit 1
else
;do your install here
endif

You miss of course the quotes around your RUN string, so I have to wonder why it installs anyway [Confused]
_________________________



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

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
this should work as well :
code:
  
if $iever < "6.0.2800.1106"
;install it
endif

_________________________



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

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
You may as well follow the suggestions by Rad and Les in your other topic [Wink]
_________________________



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 382 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.052 seconds in which 0.023 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