# BeforeAction script in Set Registry Value

**URL:** https://www.finalbuilder.com/forums/t/beforeaction-script-in-set-registry-value/1341
**Category:** Discussion
**Created:** [October 12, 2009, 4:34am UTC](https://www.finalbuilder.com/forums/t/beforeaction-script-in-set-registry-value/1341 "2009-10-12T04:34:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nelsonwolf](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/b9e5f3/32.png) [@nelsonwolf](https://www.finalbuilder.com/forums/u/nelsonwolf)
#### Post date: [October 12, 2009, 4:34am UTC](https://www.finalbuilder.com/forums/t/beforeaction-script-in-set-registry-value/1341/1 "2009-10-12T04:34:23Z")

</div>

&nbsp;How do I dynamically set Registry Root and Registry Value Type?

For type, I tried:

&nbsp;&nbsp;Action.RegValType = TRegValueType.rtString;

But I get an error that TRegValueType is undefined.

For the Registry Root, I couldn't find what i should set Action.RegRoot to.

Thanks

&nbsp;

&nbsp;

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [October 12, 2009, 10:38am UTC](https://www.finalbuilder.com/forums/t/beforeaction-script-in-set-registry-value/1341/2 "2009-10-12T10:38:10Z")

</div>

Hi Nelson   
  
 Action.RegValType = rtString   
  
 There is code completion for this property, unfortunately I discovered that some of the constants were not registered with the script engine.   
  
 For RegRoot, the constants are :   
  
 HKEY\_CLASSES\_ROOT   
 HKEY\_CURRENT\_USER   
 HKEY\_LOCAL\_MACHINE   
 HKEY\_USERS   
 HKEY\_CURRENT\_CONFIG   
  
 e.g : Action.RegRoot = HKEY\_LOCAL\_MACHINE   
  
 We’ll have a new build out later today with the RegValType constants registered.
