RegistryWrite tip...

Post your suggestions for future versions of NeoBook

Moderator: Neosoft Support

Locked
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

RegistryWrite tip...

Post 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
User avatar
Gaev
Posts: 3782
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada
Contact:

Post 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 ... S.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.
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Post 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
User avatar
Gaev
Posts: 3782
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada
Contact:

Post 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.
Neosoft Support
NeoSoft Team
Posts: 5628
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA
Contact:

Post 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.
NeoSoft Support
User avatar
fkapnist
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece
Contact:

Re: RegistryWrite tip...

Post 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....


:)
.
Locked