Skip to content

wmic deprecated and removed in recent Windows versions #228

Description

@mechelon

Hi there,

While testing our software which uses react/dns v1.13.0 on a fresh Windows Installation (Windows 11 24H2, 26100.2605), I encountered the following error:

PS C:\...> expose
'wmic' is not recognized as an internal or external command, operable program or batch file.
[2024-12-16 11:13:45] production.WARNING: preg_match_all(): Passing null to parameter #2 ($subject) of type string is deprecated in phar://....phar/vendor/react/dns/src/Config/Config.php on line 128

This is probably because Microsoft deprecated WMIC a few years ago and removed it in recent Windows 10/11 versions: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmic

My workaround is manually re-installing WMIC as described here:
https://techcommunity.microsoft.com/blog/windows-itpro-blog/how-to-install-wmic-feature-on-demand-on-windows-11/4189530

Just wanted to give you a heads-up, as this issue might occur more frequently now that WMIC is no longer included by default.

More information
Used reactphp packages:

› composer why react/dns
react/socket v1.16.0 requires react/dns (^1.13)
› composer why react/socket
react/http        v1.11.0     requires react/socket (^1.16)

Let me know if I can provide more details!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions