USBToolBox / tool

the USBToolBox tool
MIT License
936 stars 62 forks source link

Windows PE crash with "pywintypes.com_error: (2147221020, 'Invalid syntax', None, None)" #35

Closed synchromesh closed 2 years ago

synchromesh commented 2 years ago

Hi, I made a fresh WinPE USB drive and ran the 0.1.0 release, it produced the following output:

Traceback (most recent call last):
  File "Windows.py", line 7, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "wmi.py", line 174, in <module>
  File "win32com\client\__init__.py", line 85, in GetObject
  File "win32com\client\__init__.py", line 102, in Moniker
pywintypes.com_error: (-2147221020, 'Invalid syntax', None, None)
[1920] Failed to execute script 'Windows' due to unhandled exception!

My motherboard is an ASRock Z87 Extreme9/ac (Haswell) with an i7 4770K. I've installed Big Sur on it, but it's a bit ropey without its ports mapped.

Please advise... And thanks for putting this tool together for us!

dhinakg commented 2 years ago

Yea oops, my testing of Windows PE was with a Windows installer which actually includes WMI... pushing a fix for this shortly

dhinakg commented 2 years ago

Can you test the build from here? It should work fine on Windows PE builds that don't have WMI, although it's not recommended (you lose some information like controller type and descriptive device names).

synchromesh commented 2 years ago

Thanks very much, I’ll try this out this morning.

synchromesh commented 2 years ago

That seems to have done the trick, thanks very much! Ironically I had wiped a Windows installer to make the "WinPE environment", I forgot that the former was already the latter... :) Cheers!