WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Registry
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

RegSetDword and Hex Values

Keywords:     RegSetDword

Question:

Running Winbatch 99c on a WinNT 4.0 sp3 server.

Have the following line of code within a registry update script (compiled):


RegSetDword (@REGMACHINE,"system\currentcontrolset\control\timezoneinformation[ActiveTimeBias]", 0x168)
I get the following error message when I run this compiled script on a WinNT 4.0 sp4 server: 3066: Wrong Number of Arguments in Function. I have also attempted to wrap the value within quotes, but it gives me a different error message.

Any clue?

Answer:

2004F and Older sis not support passing a hex value. You needed to convert the hex value to decimal then pass it to the RegSetDword function.

RegSetDword (@REGMACHINE,"system\currentcontrolset\control\timezoneinformation[ActiveTimeBias]", 360)
Starting in WB 2004G (released Nov 29, 2004)
Added an optional parameter to RegQueryDword:

    RegQueryDword(handle, subkey-string [, flags])

      If "flags" is 1, the registry value will be returned in hexadecimal
      format.  If "flags" is 0 (or omitted), the registry value will be
      returned in decimal format.

Added an optional parameter to RegSetDword:

    RegSetDword(handle, subkey-string, value [, flags])

      If "flags" is 1, "value" will be treated as a hexadecimal number.  If
      "flags" is 0 (or omitted), "value" will be treated as a decimal number.
      Note that "value" must be a delimited string if it contains any letters.

RegSetDword (@REGMACHINE,"system\currentcontrolset\control\timezoneinformation[ActiveTimeBias]", "168", 1)

Article ID:   W14167
Filename:   RegSetDword and Hex.txt
File Created: 2005:05:02:09:19:30
Last Updated: 2005:05:02:09:19:30