Page 1 of 1

RegistryWrite tip...

PostPosted: Fri Aug 01, 2008 11:47 am
by David de Argentina
Hi Dave,

Are there any way to put into the Registry a DWORD value ?

All tries I did put a char value.

Thanks in advance,
David de Argentina

PostPosted: Fri Aug 01, 2008 1:39 pm
by Gaev
David de Argentina:
Are there any way to put into the Registry a DWORD value ?
With the ability (in NeoBook v5.6) to use VB Scripts in NeoBook Functions Called inside your pub files ... you can exploit the facilities already available from this platform.

I did a Google search with "vbs registry write" ... and came up with a couple of useful references ...

http://itknowledgeexchange.techtarget.c ... -vbscript/

http://www.computerperformance.co.uk/ezine/ezine64.htm

Then did a Google search with "RegWrite" ... and came up with these ...

http://msdn.microsoft.com/en-us/library/yfdfhz1b(VS.85).aspx

http://www.autoitscript.com/autoit3/doc ... gWrite.htm

http://www.pctools.com/guides/scripting ... =reference

http://www.devguru.com/Technologies/wsh ... Write.html


Basically, the syntax is very straight forward ... however, you need to know whether you are adding a "Value Name" or just changing its "Value" ... so a robust function would need to check this kind of thing first ... using RegRead ... trapping errors (for non-existent "Value Name") ... and proceed accordingly.

Note that one of the references points to "AutoIt" ... which can be used to make a (tiny) stand-alone exe that can be Run from NeoBook script ... passing variable data via the command line interface.

PostPosted: Fri Aug 01, 2008 2:29 pm
by David de Argentina
Thanks Gaev,

But Neo 5.6 new features are not available for spanish users yet.

I remember a lot of problems when some user update Neo with another language patch...

And I think if Dave add to this action, a new parameter like "Type of Data" (DWORD, Char, etc) he could handle it very easy...

Greetings from Buenos Aires,
David de Argentina

PostPosted: Fri Aug 01, 2008 2:59 pm
by Gaev
David de Argentina:
But Neo 5.6 new features are not available for spanish users yet.

And I think if Dave add to this action, a new parameter like "Type of Data" (DWORD, Char, etc) he could handle it very easy...
If Dave were to add this functionality ... presumably in NeoBook v5.7 ? ... whose Spanish version would be available AFTER v5.6 ... :lol:

You don't actually need v5.6 to exploit the capabilites of vbscript ... just load a "dummy" html document in a WebBrowser object ... then use BrowserExecScript to invoke it.

PostPosted: Sun Aug 03, 2008 2:19 pm
by Neosoft Support
If you're replacing an existing registry entry then NeoBook will attempt to convert the value you're writing to match the existing data type. New registry entries will be written as strings.

I don't expect that there will be more than a week or two delay between the release of the English version 5.6 and the other language versions.

Re: RegistryWrite tip...

PostPosted: Tue Dec 02, 2014 8:33 pm
by fkapnist
David de Argentina wrote:Hi Dave,

Are there any way to put into the Registry a DWORD value ?

All tries I did put a char value.

Thanks in advance,
David de Argentina



I don't think you can set Dword in registry with just the Neobook Actions. But this VB Script works very well ... just change "MyProgram.exe" with the name of your Neobook application.

Code: Select all
Option Explicit

Dim Temp

'HKEY_CURRENT_USER = HKCU
'HKEY_LOCAL_MACHINE = HKLM
'HKEY_CLASSES_ROOT = HKCR
'HKEY_USERS = HKEY_USERS
'HKEY_CURRENT_CONFIG = HKEY_CURRENT_CONFIG

Temp = WriteReg("HKCU\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION\MyProgram.exe","0","REG_DWORD")
Temp = ReadReg("HKCU\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION")
'WScript.Echo Temp
Function WriteReg(RegPath, Value, RegType)
      'Regtype should be "REG_SZ" for string, "REG_DWORD" for a integer,…
      '"REG_BINARY" for a binary or boolean, and "REG_EXPAND_SZ" for an expandable string
      Dim objRegistry, Key
      Set objRegistry = CreateObject("Wscript.shell")

      Key = objRegistry.RegWrite(RegPath, Value, RegType)
      WriteReg = Key
End Function
Function ReadReg(RegPath)
      Dim objRegistry, Key
      Set objRegistry = CreateObject("Wscript.shell")

      Key = objRegistry.RegRead(RegPath)
      ReadReg = Key
End Function


Save the above code in your Function Library (as Dword or something) and use Call "Dword" from your Neobook script....


:)
.