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
281 stars 45 forks source link

regList.wsf(0, 2) (null): 0x80041002 #117

Closed GorlikItsMe closed 9 months ago

GorlikItsMe commented 1 year ago

Electron app error

[2023-06-05 06:29:27.649] [error]                             Unhandled Exception Error: Command failed: c:\windows\system32\cscript.exe //Nologo C:\Users\PC\AppData\Local\Programs\My App\resources\vbs\regList.wsf A HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{key}_is1
C:\Users\PC\AppData\Local\Programs\My App\resources\vbs\regList.wsf(0, 2) (null): 0x80041002

    at ChildProcess.exithandler (node:child_process:407:12)
    at ChildProcess.emit (node:events:527:28)
    at ChildProcess.emit (node:domain:475:12)
    at maybeClose (node:internal/child_process:1092:16)
    at Socket.<anonymous> (node:internal/child_process:451:11)
    at Socket.emit (node:events:527:28)
    at Socket.emit (node:domain:475:12)
    at Pipe.<anonymous> (node:net:709:12)

When i try run this via shell

C:\Users\PC>c:\windows\system32\cscript.exe "C:\Users\PC\AppData\Local\Programs\My App\resources\vbs\regList.wsf" A HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{key}_is1
Microsoft (R) Windows Script Host versión 5.812
Copyright (C) Microsoft Corporation. Reservados todos los derechos.

C:\Users\PC\AppData\Local\Programs\My App\resources\vbs\regList.wsf(0, 2) (null): 0x80041002

Environment: Windows 10.0.19045 x64

kessler commented 1 year ago

is your shell running in elevation? (as administrator)

JesuisTong commented 12 months ago

My error message is:

The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. 

When i exec regList.wsf manually(of course in elevation).

Is there any service must start to run wsf scripts?

kessler commented 12 months ago

most likely it's Winmgmt service: https://learn.microsoft.com/en-us/windows/win32/wmisdk/winmgmt