Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

regedit

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

regedit

Read, Write, List and do all sorts of funky stuff to the windows registry using node.js and windows script host

  • 0.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
68K
increased by36.17%
Maintainers
2
Weekly downloads
 
Created
Source

regedit

Read, Write, List and do all sorts of funky stuff to the windows registry using node.js and windows script host.

No pesky native code :-)

Install

    npm install --save regedit

example

var regedit = require('regedit')

regedit.list('HKCU\\SOFTWARE', function(err, result) {
    ...
})

API

Every command executes a sub process that runs vbscript code. To boost efficiency, every command supports batching.

regedit.list([String|Array], [Function])

Lists the direct content of one or more sub keys. Specify an array instead of a string to query multiple keys in the same run.

Given the command:

regedit.list(['HKCU\\SOFTWARE', 'HKLM\\SOFTWARE', function(err, result) {
    ...
})

The result will look something like the following:

{
    'HKCU\\SOFTWARE': {
        keys: [ 'Google', 'Microsoft', ... more direct sub keys ]
        values: {
            'valueName': {
                value: '123',
                type: 'REG_SZ'
            }
            ... more direct child values of HKCU\\SOFTWARE
        }
    },
    'HKLM\\SOFTWARE': {
        keys: [ 'Google', 'Microsoft', ... more direct sub keys ]
        values: {
            'valueName': {
                value: '123',
                type: 'REG_SZ'
            }
            ... more direct child values of HKCU\\SOFTWARE
        }
    }
}

regedit.createKey([String|Array], [Function])

Creates one or more keys in the registry

regedit.deleteKey([String|Array], [Function])

Deletes one or more keys in the registry

regedit.putValue(Object, Function)

Put one or more values in the registry. The Object given to this function is almost identical to the result of regedit.list().

Here is an example:

var valuesToPut = {
    'HKCU\\Software\\MySoftware': {
        'myValue1': {
            value: [1,2,3],
            type: 'REG_BINARY'
        },
        'myValue2': {
            value: 'aString',
            type: 'REG_SZ'
        }
    },
    'HKCU\\Software\\MySoftware\\foo': {
        'myValue3': {
            value: ['a', 'b', 'c']
            type: 'REG_MULTI_SZ'
        }
    }
}

regedit.putValue(valuesToPut, function(err) {

})

Supported value types are:

  • REG_SZ, REG_EXPAND_SZ: a string basically
  • REG_DWORD, REG_QWORD: should use javascript numbers
  • REG_MULTI_SZ: an array of strings
  • REG_BINARY: an array of numbers (representing bytes)

Develop

Run tests

    mocha -R spec

Enable debug output

    set DEBUG=regedit

TODO

deleteValue()

Keywords

FAQs

Package last updated on 28 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc