/bundles/itninjaweb/img/Breadcrumb_cap_w.png
Hi all,

Bit of a strange one this. I have an app packaged which includes an Informix client. A key is written to the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Informix\SqlHosts\<hostname>\OPTIONS.

For our app to work this must be a null value but on install the Informix client sets it to 0 which throws up errors. How can I prevent this happening?
0 Comments   [ - ] Hide Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity

Answers

0
If I am reading your question correctly.
Try this;
'----------------code start ----------------------
Dim oNet
Set oNet = WScript.CreateObject("wscript.network")
strComputer = oNet.ComputerName
const HKEY_LOCAL_MACHINE = &H80000002
Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Informix\SqlHosts\" & strComputer
strValueName = "OPTIONS"
strValue = vbNullString
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
'----------------code end ----------------------

Regards,
Answered 05/17/2004 by: Robo Scripter
Orange Senior Belt

Please log in to comment
0
That's fantastic, thanks. I didn't mean <hostname> to refer to the local PC name though, it's the host it's connecting to. I've no experience with VB script, how would I remove the feature that looks up the local machine name?
Answered 05/18/2004 by: Gripper
Senior Yellow Belt

Please log in to comment
0
Not a problem, just a minor change.

Notice the new varible called strHostName, just replace the text between the quotes and your done.

'----------------code start ----------------------
Dim oNet
Set oNet = WScript.CreateObject("wscript.network")
strComputer = oNet.ComputerName
strHostName = "Enter the Host Name Here between the quotes"
const HKEY_LOCAL_MACHINE = &H80000002
Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Informix\SqlHosts\" & strHostName
strValueName = "OPTIONS"
strValue = vbNullString
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
'----------------code end ----------------------

I would recommend that you attempt to get a copy of the "Windows 2000 Scripting Guide" ISBN: 0735618674.
There is a wealth of information to be had there.

Kind Regards,
Answered 05/18/2004 by: Robo Scripter
Orange Senior Belt

Please log in to comment
0
That works a treat - thanks very much!

Thanks for the book recommendation too, I've been looking for one for a while now in order to start learning more about scripting.
Answered 05/18/2004 by: Gripper
Senior Yellow Belt

Please log in to comment