Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Registry.CreateKey

Creates a new registry key.

Component Version macOS Windows Linux Server iOS SDK
Registry 7.2 ❌ No ✅ Yes ❌ No ✅ Yes, on Windows ❌ No
MBS( "Registry.CreateKey"; Path; Name )   More

Parameters

Parameter Description Example
Path The path to the parent registry key.
Separated by \ you specify the path to the key you want.
Root can be Classes, CurrentUser, LocalMachine, Users, PerformanceData, CurrentConfig, DynData or the HKEY names.
"Users\test"
Name The name of the new key. "test"

Result

Returns OK or error.

Description

Creates a new registry key.
Does not return an error, if such a key exists already, so you can

Examples

Creates a key:

MBS( "Registry.CreateKey"; "CurrentUser"; "Test" )

Creates key and intermediate ones:

MBS( "Registry.CreateKey"; "CurrentUser"; "Test\MyApp\MyPref" )

Write EulaAccepted property for Whois app from Sysinternals to run it without license prompt:

Set Variable [ $r; Value: MBS( "Registry.CreateKey"; "HKEY_CURRENT_USER\SOFTWARE"; "Sysinternals") ]
Set Variable [ $r; Value: MBS( "Registry.CreateKey"; "HKEY_CURRENT_USER\SOFTWARE\Sysinternals"; "Whois") ]
Set Variable [ $r; Value: MBS( "Registry.SetValue"; "HKEY_CURRENT_USER\SOFTWARE\Sysinternals\Whois"; "EulaAccepted"; 1; "DWORD" ) ]

See also

This function checks for a license.

Created 20th March 2017, last changed 31st March 2021


Registration - Registry.DeleteKey