Click or drag to resize

WindowsUtilitiesRename Method

Renames the specified registry key.

Namespace:  callback.ShellBoost.Core.Utilities
Assembly:  callback.CBFSShell (in callback.CBFSShell.dll) Version: 22.0.0.0
Syntax
C#
public static int Rename(
	this RegistryKey key,
	string oldName,
	string newName,
	bool throwOnError = true
)

Parameters

key
Type: Microsoft.Win32RegistryKey
The registry key.
oldName
Type: SystemString
The old name.
newName
Type: SystemString
The new name.
throwOnError (Optional)
Type: SystemBoolean
true to throw error; otherwise false.

Return Value

Type: Int32
An error or 0 if operation was successful.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type RegistryKey. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionoldName is null or newName is null.
ArgumentExceptionkey has an invalid handle.
See Also