Source language: Translate to:

RegistryWrite tip...

Post your suggestions for future versions of NeoBook

Moderator: Neosoft Support

RegistryWrite tip...

Postby David de Argentina » Fri Aug 01, 2008 11:47 am

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

Postby Gaev » Fri Aug 01, 2008 1:39 pm

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

Postby David de Argentina » Fri Aug 01, 2008 2:29 pm

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

Postby Gaev » Fri Aug 01, 2008 2:59 pm

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

Postby Neosoft Support » Sun Aug 03, 2008 2:19 pm

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

Re: RegistryWrite tip...

Postby fkapnist » Tue Dec 02, 2014 8:33 pm

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


:)
.
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece


Return to NeoBook Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest