Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regedit is either undefined or returns unknown error code 1 for electron #115

Closed
eaugustin2 opened this issue Mar 3, 2023 · 1 comment
Closed

Comments

@eaugustin2
Copy link

eaugustin2 commented Mar 3, 2023

I'm trying to have regedit create a key in HKCU, however I constantly get undefined as the error in the callback. Prior to this I was getting alot of vbsscript unknown error code 1 messages.

My declaration for regedit is as follows:
import regedit from 'regedit'; regedit.setExternalVBSLocation('resources/regedit/vbs'); Or

import regedit from 'regedit'; const vbsPath = path.join(path.dirname(remote.app.getPath('exe')), 'resources/regedit/vbs'); regedit.setExternalVBSLocation(vbsPath);

The way I use regedit is also as follows:
await regedit.createKey(['HKCU\\SOFTWARE\\path_to_folder'], function(err, result) { console.log('err for create key: ', err); console.log('result: ', result); })
Or

regedit.createKey(['HKCU\\SOFTWARE\\path_to_folder'], function(err, result) { console.log('err for create key: ', err); console.log('result: ', result); })

Both cases yield the same results and i'm not sure where the issue is. Is there supposed to be files at the end of the setExternalVBSLocation path? If so please direct me to them, if not what might be the issue in this case?

I'm operating on Windows 10, Electron 12.2.3, node 14.17.0.

I've also read and implemented #60 , however still no avail

@pspaulding
Copy link

I was running into the same issue. Don't know if this helps or not, but I eventually determined that it was because I was attempting to put invalid (negative) REG_DWORD values. Limiting my values to positive numbers fixed the problem. So, make sure that the values that you are attempting to put make sense.

@kessler kessler closed this as completed Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants