/build/static/layout/Breadcrumb_cap_w.png

[SOLVED] Stupid question #2: DWORD registry value in hexadecimal

OK, here's another question which reveals just how new to the KBOX I am:

In a Kscript, in my Task section, I'm using the step "Set a registry value". The registry value I want to set is a DWORD, and I know its hexadecimal value.

How do I type this hexadecimal value into the Data text field so that it will be interpreted as hexadecimal and not decimal? (For example, do I need the leading "0x" prefix?) Does this text box assume that DWORDs are in decimal?

When I edit the same registry value in RegEdit, I have a radio button that lets me toggle between hex/decimal, but nothing here that indicates the correct syntax. Sande

0 Comments   [ + ] Show comments

Answers (7)

Posted by: airwolf 14 years ago
Red Belt
0
Try it out one way, and if it doesn't work then try the other. I haven't written DWORD values with scripting yet, so I can't say one way or the other. However, it is likely that the KBOX will determine based on a REGEX of whatever you enter. If you put 0x.... it may automatically write in hex, and without a 0x it may just write as decimal. I know in reg files you need to prefix a hex value with "hex:" (i.e. hex:0xffffffff), but I'm not sure how the KBOX interprets the values in the field.
Posted by: GillySpy 14 years ago
7th Degree Black Belt
0
The type would be REG_DWORD and the value would be somthing like
dword:0000007b

(that's 123 decimal)
Posted by: airwolf 14 years ago
Red Belt
0
Just clarify, Gerald, does that mean a decimal value would just be entered into the field? Or do you HAVE to use hex?
Posted by: GillySpy 14 years ago
7th Degree Black Belt
0
The value in the registry is equivalent whether it's decimal or hex is up to you. using 123 as an example. When looking at registry editor at an item represented in decimal it looks like this:
123
when hex it looks like this
0x0000007b

To tell the kbox to put in decimal 123 you enter: 123
To tell the kbox to put in hex equivalent you enter: dword:0000007b
Posted by: airwolf 14 years ago
Red Belt
0

To tell the kbox to put in decimal 123 you enter: 123
To tell the kbox to put in hex equivalent you enter: dword:0000007b


Excellent, this is the clarification I was looking for. I wasn't sure if the DellKACE dev-wizards put in some REGEX function to automatically determine whether it's hex or dec by the use of the 0x prefix. [;)] I guess not.
Posted by: GillySpy 14 years ago
7th Degree Black Belt
0
Okay i should not hit "OK" so soon...

The value in the registry is equivalent whether it's decimal or hex is up to you. using 123 as an example. When looking at registry editor at an item represented in decimal it looks like this:
123
when hex it looks like this
0x0000007b

To tell the windows registry editor to put in decimal 123 you enter: 123 and "decimal"
To tell the windows registry editor to put in hex equivalent you enter: 7b and choose "hexadecimal"
To tell the kbox to put in hex equivalent you enter: dword:0000007b

AFAIK: you can't specificy hex or decimal so you enter it as (dword:0000007b)

If you don't know the hex the built-in windows "programmer" calculator can translate it for you or you can view it in the registry
Posted by: snissen 14 years ago
Fourth Degree Green Belt
0
Now that we're testing these dword: values, we found they are not working.

What is working for registry DWORDs is to specify the value as 0x12345678 (no dword: in front). This 0x hexadecimal notation is also what the Configuration Policy wizard generates in a "Windows Automatic Updates Settings" script. Sande
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ