cantademorna
MIS
Hi There,
I was looking for a way to be able to manipulate the registry
on Windows 7 64 bit machine via vbscript.
The below code works fine on a 32 bit machine running XP Pro
I understand that the following reference:
REG_KEY_PATH = "HKLM64\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\XXX"
or
REG_KEY_PATH = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\XXX"
might be needed, but don't know how to get it to work.
...nevertheless I can't see what's in the "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\XXX"
registry location. Is there tweaking to the code to actually see what's in there?
BTW lResult is always null, should have the name of the reg entry.
Many Thanks people
Andrew
--------------------------------------------------------------
On Error Resume Next
Dim RegObj
Dim SysEnv
Set RegObj = WScript.CreateObject("WScript.Shell")
'***** Specify the DSN parameters *****
DataSourceName = "XYZ_NoddyDataMart"
DatabaseName = "NoddyDataMart"
Description = "NoddyDataMart"
LastUser = ""
Server = "XYZ"
'if you use SQL Server the driver name would be "SQL Server"
DriverName = "SQL Server"
'Set this to True if Windows Authentication is used
'else set to False or comment out
WindowsAuthentication = True
'point to DSN in registry
REG_KEY_PATH = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\XXX"
' Open the DSN key and check for Server entry
lResult = RegObj.RegRead (REG_KEY_PATH & "\Server")
'if lResult is nothing, DSN does not exist; create it
if lResult = "" then...........
I was looking for a way to be able to manipulate the registry
on Windows 7 64 bit machine via vbscript.
The below code works fine on a 32 bit machine running XP Pro
I understand that the following reference:
REG_KEY_PATH = "HKLM64\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\XXX"
or
REG_KEY_PATH = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\XXX"
might be needed, but don't know how to get it to work.
...nevertheless I can't see what's in the "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\XXX"
registry location. Is there tweaking to the code to actually see what's in there?
BTW lResult is always null, should have the name of the reg entry.
Many Thanks people
Andrew
--------------------------------------------------------------
On Error Resume Next
Dim RegObj
Dim SysEnv
Set RegObj = WScript.CreateObject("WScript.Shell")
'***** Specify the DSN parameters *****
DataSourceName = "XYZ_NoddyDataMart"
DatabaseName = "NoddyDataMart"
Description = "NoddyDataMart"
LastUser = ""
Server = "XYZ"
'if you use SQL Server the driver name would be "SQL Server"
DriverName = "SQL Server"
'Set this to True if Windows Authentication is used
'else set to False or comment out
WindowsAuthentication = True
'point to DSN in registry
REG_KEY_PATH = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\XXX"
' Open the DSN key and check for Server entry
lResult = RegObj.RegRead (REG_KEY_PATH & "\Server")
'if lResult is nothing, DSN does not exist; create it
if lResult = "" then...........