New functions for handling the Registry
Apr 4, 2023
2
964
Improving the reg
function and adding a new reg.exists
, reg.get
, reg.set
, reg.delete
functions.
The first parameter, which is the root key, was combined with the subkey path into one parameter to be compatible with REG COMMANDS.
The keyname must include a valid root key. Valid root keys for the local computer are:
HKCU
HKCR
HKLM
HKU
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
REG.EXISTS
Check that the key name exists
reg.exists('HKCU\Control Panel\Desktop')
Check that the value name exists
reg.exists('HKCU\Control Panel\Desktop', "WallPaper")
REG.GET
Read data by value name
reg('HKCU\Control Panel\Desktop', "WallPaper")
reg.get('HKCU\Control Panel\Desktop', "WallPaper")
reg.get('HKCU\Control Panel\Desktop')
REG.SET
The reg.set
function allows creating a subkey with the value name and value data
Create Subkey
reg.set('HKCU\Software\Nilesoft\Shell')
Create Subkey with value and set value data type
reg.set('HKCU\Software\Nilesoft\Shell', "test-int", 1, reg.dword)
reg.set('HKCU\Software\Nilesoft\Shell', "test-str", 1, reg.sz)
reg.set('HKCU\Software\Nilesoft\Shell', "test-str", 'some string', reg.sz)
Set value data with auto type detection
reg.set('HKCU\Software\Nilesoft\Shell', 'test-auto-int', 1)
reg.set('HKCU\Software\Nilesoft\Shell', 'test-auto-str', 'some string')
REG.DELETE
The reg.delete
function allows deleting a subkey or deleting a value
Delete value name
reg.delete('HKCU\Software\Nilesoft\Shell', 'test-auto')
Delete subkey
reg.delete('HKCU\Software\Nilesoft\Shell')
2 Comments
I'm a complete beginner with this stuff, so much so that I can't even get the "Hello World" thing to work 🤣
All I need is to be able to right-click a file, and select an option that will run a pre-defined renaming scheme on it. For example, replacing underscores with spaces.
Is that possible with this particular tool? If so, what would the code look like? And would I need special code so that the .ext isn't renamed? And would the code be even more different if I select multiple files to rename instead of just one? And is different code needed to deal with directory names? As you can see, I'm completely clueless.
Thanks for your help! And thank you for this tool, even without the particular function I need it's still a huge improvement over the standard shell menu. I can see me using this as a default install from here on.
There are functions that can be used to rename files and folders as well.
See the following example where it provides a menu item that replacing underscores with spaces.
Add this code to dynamic section in the "shell.nss" file
Save changes, Restart Explorer to apply new settings.