Kaseya Community

How to use SET REGISTRY VALUE to create a key's (Default) value?

  • Hopefully I am just missing something obvious, but how do you code the SET REGISTRY VALUE command to set the value of any key's (Default) value?

    e.g. I want to create
    HKLM\CurrentControlSet\Control\Safeboot\Network\KaseyaAgent\(Default)
    and assign it the REG_SZ value of "Service". I tried:

    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\KaseyaAgent\(Default)
    Parameter 2 : Service
    Parameter 3 : REG_SZ


    The above did create a key & value, but it resulted in two values, each appearing under the key as (Default).

    I also tried the above without the parentheses, but that just creates a value named Default.

    TIA,
    -Mike

    NOTE: for some reason this HTML editor inserted a space in KaseyaAgent above. I couldn't get rid of the space...

    Legacy Forum Name: How to use SET REGISTRY VALUE to create a key's (Default) value?,
    Legacy Posted By Username: ReedMikel
  • ReedMikel
    Hopefully I am just missing something obvious, but how do you code the SET REGISTRY VALUE command to set the value of any key's (Default) value?

    e.g. I want to create
    HKLM\CurrentControlSet\Control\Safeboot\Network\KaseyaAgent\(Default)
    and assign it the REG_SZ value of "Service". I tried:

    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\KaseyaAgent\(Default)
    Parameter 2 : Service
    Parameter 3 : REG_SZ


    The above did create a key & value, but it resulted in two values, each appearing under the key as (Default).

    I also tried the above without the parentheses, but that just creates a value named Default.

    TIA,
    -Mike

    NOTE: for some reason this HTML editor inserted a space in KaseyaAgent above. I couldn't get rid of the space...


    To eliminate the space, use CODE tags. To create (Default) values, you have to import REG files or run a shell command and run REG.EXE with the /ve switch.

    Michael

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: RCS-Michael
  • Thanks for confirming what I was afraid the answer was going to be Sad
    I'll submit a Feature Request to Kaseya to enhance the SET REGISTRY VALUE command...

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: ReedMikel
  • The "default" value may be set by just ending the registry value parameter name with a trailing backslash \. In the example given, you should enter:

    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Safeboot\Network\KaseyaAgent\
    Parameter 2 : Service
    Parameter 3 : REG_SZ


    -Paul

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Paul.Wong
  • Paul.Wong
    The "default" value may be set by just ending the registry value parameter name with a trailing backslash \. In the example given, you should enter:

    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Safeboot\Network\KaseyaAgent\
    Parameter 2 : Service
    Parameter 3 : REG_SZ


    -Paul


    Yes, this will actually work for the OP. I just went back and re-read what he was trying to do. However, one must be careful of trying to modify *any* default value using this method. Some default values are REG_SZ types but some are REG_NONE types. To work with REG_NONE types, you must use another method. That was what I had in mind when I answered this as I recently came across this limitation with something I was trying to script within Kaseya.

    Michael

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: RCS-Michael
  • Thanks Paul - worked perfectly! Maybe Kaseya could add a note describing this to the help file, as well as in the script editor screen (to the description that displays for this command)? Apologies if I missed it in the docs...
    Thanks,
    -Mike

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: ReedMikel
  • Mike,

    Glad it worked for you. I will check on the help file and have the description about the (default) value added.

    -Paul

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Paul.Wong