0

I am trying to set and unset registry with values 1 and 0 respectively. I am using regedit npm package to achieve this.

Upon unset,I want this registry value to be 0. I see the function UnsetRegistryValue being called, but it doesn't set the value to 0. Please note, already registry value set to 1. I want to replace registry value

**set registry **
function setRegistryValue(){

 regedit.putValue({
        'HKLM\\System\\CurrentControlSet\\Control\\Session Manager\\Environment': {
           'XYZ': {
                value: '1',
                type: 'REG_SZ'
            },
           'Version': { }
        }
    }, function(err) {app.console.log(err);});

}

**unset registry **
function UnsetRegistryValue(){

 regedit.putValue({
        'HKLM\\System\\CurrentControlSet\\Control\\Session Manager\\Environment': {
           'XYZ': {
                value: '0',
                type: 'REG_SZ'
            },
           'Version': { }
        }
    }, function(err) {app.console.log(err);});

}

karansys
  • 2,449
  • 7
  • 40
  • 78

1 Answers1

0

Sorry, I had typo in the to set or unset or modify.You can use regedit.putValue

karansys
  • 2,449
  • 7
  • 40
  • 78