vscode: Can't open vscode and it will flashback without anything

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.79.2
  • OS Version: Windows 10 Enterprise 22H2

Steps to Reproduce:

  1. In CMD I use the instruct: cd C:\Program Files\Microsoft VS Code (the road vscode install) C:\Program Files\Microsoft VS Code>code
  2. It will open and flashback with the error report: [main 2023-06-16T05:15:52.896Z] update#setState idle [3204:0616/131553.294:ERROR:electron_api_utility_process.cc(123)] Failed to create null handle: System cannot find the specified file. ( 0x2) 3.except this, system work right, such chrome and visual studio.And the GPU drive is latest. 4.I have tried --no-sandbox,it no use. And I also uninstall vscode many times, delete that two directories to deeply clear.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 31 (13 by maintainers)

Most upvoted comments

@shellvon That’s Great! I restart this service and vscode finally can be used. It seems that the service has shot down by an error. Thank you for your answer. sc query null sc create null binPath= C:\Windows\System32\drivers\null.sys type= kernel start= auto error= normal

@Ambit15 Accodring your error logs:

[3204:0616/131553.294:ERROR:electron_api_utility_process.cc(123)] Failed to create null handle: System cannot find the specified file.

It’s reported from electron source code here:

https://github.com/electron/electron/blob/e61359598214399cab97ca6a8ad541983059c331/shell/browser/api/electron_api_utility_process.cc#L123C25-L123C55

And you see, If electron run on windows and need utilityProcess, it’s need the NULL kernel service to run correctly. but it seems that your windows system was missing it.

You can check it by run sc command by using cmd.exe:

sc query null

it produce the output like this:

SERVICE_NAME: null
        TYPE               : 1  KERNEL_DRIVER
        STATE              : 4  RUNNING
                                (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0

if you don’t have this service, you can create it by following command:

sc create null binPath= C:\Windows\System32\drivers\null.sys type= kernel start= auto error= normal

But you need make sure the file C:\Windows\System32\drivers\null.sys exists. you can download it by using google search or from another windows machine with same version.

Since my response indeed helped resolve the issue, I also answered the question on Stack Overflow in the hope of assisting more people who encounter similar problems.

Refs: