flutter_udid icon indicating copy to clipboard operation
flutter_udid copied to clipboard

Windows 11 wmic error

Open raitech12 opened this issue 10 months ago • 3 comments
trafficstars

Hi

I get this error on windows 11 'wmic' is not recognized as an internal or external command, operable program or batch file. flutter: PlatformException(NO_DATA_READ, No data read from wmic command, null, null)

raitech12 avatar Jan 05 '25 08:01 raitech12

Using this maybe better

Get-WmiObject -Class Win32_Bios | Select SerialNumber

raitech12 avatar Jan 05 '25 09:01 raitech12

std::string GetBiosSerialNumber() { Wmi::Server server{ L"ROOT\CIMV2" }; Wmi::ObjectEnumerator enumerator = server.Query(L"SELECT SerialNumber FROM Win32_Bios"); for (auto& object : enumerator) { return object.GetString(L"SerialNumber"); } return ""; }

raitech12 avatar Jan 05 '25 09:01 raitech12

Hey, could you create a PR for this?

GigaDroid avatar Feb 10 '25 10:02 GigaDroid

fix, https://github.com/GigaDroid/flutter_udid/pull/60

I have manually tested and confirmed that it works. However, I do not have access to a Windows 11 version 24H2 system. Please test it further on actual hardware.

huanguan1978 avatar Feb 19 '25 17:02 huanguan1978

Thanks to @GigaDroid for this excellent, lightweight, and powerful plugin.

This pull request is safe to merge. I've already integrated it into my own branch and successfully implemented it in the Windows version of my application, Gai: Generative-AI Tools For Beginner.

See Gai's listings on the Microsoft Store and Softpedia for reviews:

Gai's release can also be considered a successful use case for the flutter_udid plugin.

huanguan1978 avatar Mar 17 '25 20:03 huanguan1978