ScriptLogic.com: Windows Management…Point, Click, Done


Desktop Management

Windows Servers & Security

Other Products




Custom Script: C0027

Overview:

Installing the Oracle client, only configures the ODBC data sources for the user that installed it. This custom script will automatically configure the ODBC data sources for any user that logs on to the computer -- without the need to re-run the Oracle client setup or configure ODBC through the control panel.
 

Add these line(s) to your Custom Script:

;Setup ODBC for Oracle Server [Begin]
;Create the necessary keys, values and expressions for current user.
$CR=chr(13)
$OraServer='server1'
$KeyBase='HKEY_CURRENT_USER\Software\ODBC\ODBC.INI'
$Key1='$KeyBase\ODBC Data Sources'
$Key2='$KeyBase\$OraServer'
if existkey($Key2) ; key don't exist, so create it.
  $result=addkey($Key2)
  $result=writevalue($Key1,'','Oracle ODBC Driver','REG_SZ')   ; sets (Default) value
  $result=writevalue($Key1,'$OraServer','Oracle ODBC Driver','REG_SZ')
  $result=writevalue($Key2,'','1','REG_SZ')                    ; sets (Default) value
  $result=writevalue($Key2,'Application Attributes','T','REG_SZ')
  $result=writevalue($Key2,'Attributes','W','REG_SZ')
  $result=writevalue($Key2,'Description','','REG_SZ')
  $result=writevalue($Key2,'Driver','c:\orant\bin\sqora32.dll','REG_SZ')
  $result=writevalue($Key2,'PrefetchCount','1','REG_SZ')
  $result=writevalue($Key2,'ServerName','$OraServer','REG_SZ')
  $result=writevalue($Key2,'Translation DLL','','REG_SZ')
  $result=writevalue($Key2,'Translation Option','0','REG_SZ')
  $result=writevalue($Key2,'UserID','','REG_SZ')
endif
;Setup ODBC for Oracle Server [End]

Created: 07 December, 1999
Last Revised: 22 July, 2004