Dear,

We found an oracle script from the past. It was necessary to upgrade:
- from 16bits to 32bits version.
- related DNS names must be changed. so 16bits and 32bits versions must be replaced.

First we are trying to calculate which version was installed. In our
situation it was a known situation: orawin, orawin95 or orant.

Secondly we calculates which program type was installed: F45RUN.EXE or F45RUN32.EXE

Third we replace only 16bits version when F45RUN.EXE exist or
we replace only 32bits version when F45RUN32.EXE exist.
code:
  IF setconsole("hide")
ENDIF
;
; NT/95 logging - Kixtart 3.62, 3.63
;
; (c) scripting@wanadoo.nl, 2000
;
; 1.00 (20001025) original version
;
$prgrm_version="1.00"
;
IF (@inwin = 1)
$NT_mode="yes"
ELSE
$NT_mode="no"
ENDIF
break off
flushkb

; - :script_oracle_location

$f45run="orawin" ; - bin\f45run.exe -
$f45run_info="NONE"
IF (exist("c:\orawin\bin\f45run.exe") = 1)
$f45run="orawin"
ELSE
IF (exist("c:\orawin95\bin\f45run.exe") = 1)
$f45run="orawin95"
ELSE
IF (exist("c:\orant\bin\f45run.exe") = 1)
$f45run="orant"
ELSE
$f45run="NONE"
ENDIF
ENDIF
ENDIF
;
$f45run32="orawin95" ; - bin\f45run32.exe -
$f45run32_info="NONE"
IF (exist("c:\orawin95\bin\f45run32.exe") = 1)
$f45run32="orawin95"
ELSE
IF (exist("c:\orawin\bin\f45run32.exe") = 1)
$f45run32="orawin"
ELSE
IF (exist("c:\orant\bin\f45run32.exe") = 1)
$f45run32="orant"
ELSE
$f45run32="NONE"
ENDIF
ENDIF
ENDIF

; - :script_oracle_update

$oracle_update="o:\oracle\tnsnames.ora" ; <- new version -
$oracle16="c:\"+$f45run+"\network\admin\tnsnames.ora"
$oracle32="c:\"+$f45run32+"\network\admin\tnsnames.ora"
$oracle_info="ORACLE-UPDATE "

IF (exist($oracle_update) = 1) AND (exist($oracle16) = 1)
IF ($NT_mode = "yes")
shell "%comspec% /e:1024 /c c:\winnt\system32\attrib.exe -r "+$oracle16
ELSE
shell "%comspec% /e:1024 /c c:\windows\command\attrib.exe -r "+$oracle16
ENDIF
copy $oracle_update $oracle16
IF (@error = 0)
ENDIF
$oracle_info=$oracle_info+" "+LCASE($oracle16)
ELSE
$oracle_info=$oracle_info+" "+$f45run+"-SKIP-"
ENDIF
;
IF (exist($oracle_update) = 1) AND (exist($oracle32) = 1)
IF ($NT_mode = "yes")
shell "%comspec% /e:1024 /c c:\winnt\system32\attrib.exe -r "+$oracle32
ELSE
shell "%comspec% /e:1024 /c c:\windows\command\attrib.exe -r "+$oracle32
ENDIF
copy $oracle_update $oracle32
IF (@error = 0)
ENDIF
$oracle_info=$oracle_info+" "+LCASE($oracle32)
ELSE
$oracle_info=$oracle_info+" "+$f45run32+"-SKIP-"
ENDIF

; --------------------------------------------------------------------------

; IF ($debug_mode = "yes")
?
? " F45run "+$f45run
? " F45run32 "+$f45run32
?
? " oracle info "+$oracle_info
?
; ENDIF

:end_script
break on
flushkb

Above code may gives you other ideas.
greetings.

btw: about related INIs see next reaction about WIN.INI and ORACLE.INI
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA