Renaming a registry entry

(imported topic written by SystemAdmin)

Im trying to determine if there is a key in the SNMP configuration called “public” if there is I just want to rename it to something else like “public1”

I can find if the key exists but changing it is the issue

I cant just delete it and add a new entry because there’s lots of keys below it associated to the “Public” key

Q: if exists key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration” of registry then exists key “public” of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration” of registry else false

A: True

T: 0.152 ms

(imported comment written by jessewk)

If you don’t want to remove the whole key, you can just use the ‘regdelete’ or ‘regdelete64’ command and specify a specific value. Syntax:

regdelete64 “” “”

If that doesn’t do it, then I don’t know a way to rename without writting a script to do it using Windows API calls.

(imported comment written by SystemAdmin)

Thank you jessewk

Correct I dont want to delete the Key, there lots of settings under that key,

I will have to come up with a script…

Thanks Again