kessler / node-regedit

Read, Write, List and do all sorts of funky stuff to the windows registry using node.js and windows script host
MIT License
279 stars 45 forks source link

Error with large numbers in REG_DWORD and REG_QWORD #21

Closed zariweyo closed 7 years ago

zariweyo commented 7 years ago

To solve this, please, in file regUtil.vbs replace CInt to CLng. (lines 37 and 43).

Thanks

kessler commented 7 years ago

@zariweyo could you please provide some code that will help me recreate the problem? thanks

juanjo75es commented 7 years ago

It still fails for me after making changes suggested by zariweyo

                                                      let valuesToPut = {};
                                                      valuesToPut[s3] = {
                                                        'FolderValueFlags': {
                                                          value: 0x28,
                                                          type: 'REG_DWORD'
                                                        },
                                                        'Attributes': {
                                                          value: 0xF080004D,  
                                                          type: 'REG_DWORD'
                                                        }
                                                      };

                                                      regedit.putValue(valuesToPut, function(err) {
                                                        if(typeof err !== "undefined")
                                                          console.log(err);
                                                        else{

                                                        }
                                                      })
kessler commented 7 years ago

@juanjo75es currently very busy... so it will take time to get to this. However, if you run into a solution in the meanwhile, please don't hesitate to send a PR

nhz-io commented 7 years ago

REG_DWORD

nhz-io commented 7 years ago

REG_QWORD

I dont see a way to overcome the precision limit on writing :cry:

juanjo75es commented 7 years ago

@kessler Well ... I solved my problem using:

var exec = require('child_process').exec;
exec( "reg add (...)" , function(error, stdout, stderr){});

But I guess it won't help you.

kessler commented 7 years ago

@juanjo75es thanks for sharing the solution :)