|
155 | 155 | set "tool1=rexx.exe"
|
156 | 156 | set "tool2=datetime.rexx"
|
157 | 157 |
|
| 158 | + set "did_WMIC=" |
| 159 | + set "have_WMIC=" |
| 160 | + |
158 | 161 | set "tdir="
|
159 | 162 | set "tname="
|
160 | 163 | set "noexit="
|
|
362 | 365 | ::-----------------------------------------------------------------------------
|
363 | 366 | :LocalDateTime
|
364 | 367 |
|
| 368 | + REM "wmic" is no longer INSTALLED starting with Windows 11 24H2. |
| 369 | + REM Note however, if Windows 11 24H2 was simply UPGRADED TO from |
| 370 | + REM a previous Windows 10 or 11 installtion, then it should still |
| 371 | + REM exist. 24H2 does NOT remove it. It simply no longer INSTALLS |
| 372 | + REM it by default. So only those who do a fresh INSTALL of 24H2 |
| 373 | + REM or later are affected/impacted. |
| 374 | + |
| 375 | + if defined did_WMIC ( |
| 376 | + |
| 377 | + if not defined have_WMIC ( |
| 378 | + |
| 379 | + REM "wmic" doesn't exist! We have no choice but to use the |
| 380 | + REM existing builtin %date% and %time% batch variables. For |
| 381 | + REM most people using the same date/time format as the U.S. |
| 382 | + REM this will work just fine. For other countries/languages |
| 383 | + REM however, this will cause incorrectly formatted "Begin" |
| 384 | + REM and "End" and "Duration" messages. But without WMIC, we |
| 385 | + REM really have no choice in the matter! The only good news |
| 386 | + REM is that this is a purely cosmetic issue, and does not |
| 387 | + REM otherwise impact the overall functioning of the runtest |
| 388 | + REM script. It will still work fine. You will just see some |
| 389 | + REM very unusual "Begin" and "End" time messages, and your |
| 390 | + REM "Duration" message will be WILDLY inaccurate! |
| 391 | + |
| 392 | + %return% |
| 393 | + ) |
| 394 | + ) else ( |
| 395 | + |
| 396 | + set "did_WMIC=yes" |
| 397 | + |
| 398 | + call :fullpath "wmic.exe" |
| 399 | + |
| 400 | + if defined # set "have_WMIC=yes" |
| 401 | + if not defined # %return% |
| 402 | + ) |
| 403 | + ) |
| 404 | + |
365 | 405 | setlocal
|
366 | 406 |
|
367 | 407 | REM -----------------------------------------------------------------------
|
|
0 commit comments