Skip to content

getDayOfWeek: fix hang on Windows 11 24H2+ - #358

Open
pps83 wants to merge 3 commits into
IbcAlpha:masterfrom
pps83:master-dayOfWeek
Open

getDayOfWeek: fix hang on Windows 11 24H2+#358
pps83 wants to merge 3 commits into
IbcAlpha:masterfrom
pps83:master-dayOfWeek

Conversation

@pps83

@pps83 pps83 commented May 15, 2026

Copy link
Copy Markdown
Contributor

wmic hangs indefinitely on recent Windows builds, leaving Gateway launches stuck after the banner with no log file and no Java spawned.

closes #357

pps83 added 2 commits May 15, 2026 18:16
wmic hangs indefinitely on recent Windows builds, leaving Gateway launches stuck after the banner with no log file and no Java spawned.

closes IbcAlpha#357
@pps83

pps83 commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

After this change, it again deadlocked on this:

for /f "usebackq tokens=* skip=3" %%a in (`powershell -command "Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, OSArchitecture"`) do echo Operating system:  %%a

I had to switch it to echo Operating system: %OS% %PROCESSOR_ARCHITECTURE% to make it work. No idea what was wrong.

 + remove getDayOfWeek.bat (wmic is deprecated)
@gaanthony

Copy link
Copy Markdown

Confirming the same root cause from a slightly different angle, in case it's a useful data point for merging this.

On Windows 11 build 10.0.26200 (24H2+), wmic isn't just slow/hanging — it's been fully removed (the WMIC Feature-on-Demand isn't installed by default anymore). So instead of the deadlock in #357, getDayOfWeek.bat fails fast with 'wmic' is not recognized as an internal or external command, IBC continues, but DAYOFWEEK ends up empty and the log filename is wrong. Same root cause (wmic deprecation), two different symptoms depending on whether the box has wmic-present-but-broken vs wmic-absent.

The (Get-Date).DayOfWeek approach in this PR fixes both cleanly, and it's worth noting why it's the right replacement: Get-Date is pure .NET and never touches the WMI/CIM subsystem, so it can't reproduce the CIM hang you hit afterwards with Get-CimInstance Win32_OperatingSystem. I applied the equivalent one-liner locally (for /f %%a in ('powershell -NoProfile -Command "[int]((Get-Date).DayOfWeek)"') do set DAYOFWEEK=%%a) on a 10.0.26200 box and it resolves correctly and fast.

Thanks for 23 years of IBC.

@rlktradewright

Copy link
Copy Markdown
Member

I'll be making a new release in the near future which contains this fix.

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.

IBC hangs on windows

3 participants