Skip to content

fix: Windows process discovery without WMIC - #1725

Closed
wenyt (wenytang-ms) wants to merge 1 commit into
mainfrom
wenytang-ms-fix-windows-process-enumeration
Closed

wenyt (wenytang-ms) wants to merge 1 commit into
mainfrom
wenytang-ms-fix-windows-process-enumeration

Conversation

@wenytang-ms

Copy link
Copy Markdown
Contributor

Summary

Fixes #1721.

Windows process discovery currently invokes WMIC.exe, which is no longer available on updated Windows 11 installations. This breaks both the Java process picker and attachment using an explicit processId.

  • Replace WMIC with the system Windows PowerShell executable running Get-CimInstance Win32_Process; no PowerShell 7 installation is required.
  • Read structured JSON with explicit UTF-8 output, preserving process IDs, parent IDs, command lines, and the existing creation-date format.
  • Keep quoted executable paths and JDWP arguments intact, skip inaccessible/empty command lines, and reject malformed output or failed queries.
  • Leave Linux/macOS process discovery unchanged and document the Windows discovery mechanism.

Validation

  • Reproduced the original spawn ... WMIC.exe ENOENT failure on Windows with WMIC absent.
  • npm run compile — passed.
  • npm run tslint — passed.
  • node_modules\.bin\mocha.cmd --ui tdd out\test\processTree.test.js — 16 tests passed, including live Windows PowerShell/CIM enumeration.
  • Live JVM smoke check without WMIC: explicit PID resolution and process-picker discovery resolved the same JVM and debug endpoint; a TCP JDWP handshake succeeded. The picker UI was stubbed for this check.

Regression coverage includes quoted paths, JDWP arguments, missing command lines, chunked/non-ASCII UTF-8 output, empty lists, invalid JSON/records, startup/query/exit failures, and process-tree construction.

@wenytang-ms wenyt (wenytang-ms) changed the title Fix Windows process discovery without WMIC fix: Windows process discovery without WMIC Oct 28, 2026
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

Successfully merging this pull request may close these issues.

attach by processId fails on windows due to removed wmic.exe

1 participant