Tibor17 commented on issue #3176:
URL: 
https://github.com/apache/maven-surefire/issues/3176#issuecomment-3899654306

   It does not matter if you are calling WMIC or PowerShell because both might 
be unavailable on the system.
   The point here is that I designed the utility so that the first crash of the 
native command should fallback to PING which is platform independent mechanism.
   
   I downloaded the appliance `WinDev2407Eval.ova` and created VM in 
VirtualBox. It contains Microsoft Windows 11 Enterprise Evaluation. WMIC was 
officially deprecated in Windows 10, it should not be shipped with Windows 11 
(22H2+) but the reality is different because my Windows 11 Enterprise 
Evaluation (22H2).
   
   PowerShell is not installed and enabled by default:
   `pwsh --version`
   ```'pwsh' is not recognized as an internal or external command,
   operable program or batch file.```
   
   Windows 11 contains `tasklist.exe` but Windows XP Home does not have
   `tasklist.exe` binary installed but XP Professional contains tasklist.
   
   `$ wmicx process where ProcessId=3092`
   ```No Instance(s) Available.
   java.io.IOException: Cannot run program "wmicx": CreateProcess error=2,
   The system cannot find the file specified```
   
   `$ tasklist /M /FI "pid eq 3093"`
   ```INFO: No tasks are running which match the specified criteria.```
   
   `$ wmic process where ProcessId=3093`
   ProcessBuilder.waitFor() returns exit code 0
   
   
   `$ tasklist /M /FI "pid eq 3092"`
   ```Image Name    PID Modules
   ============ ============
   svchost.exe      3092 N/A```
   
   `$ wmic process where ProcessId=3092`
   ```Caption      ProcessId
   svchost.exe  3092```
   ProcessBuilder.waitFor() returns exit code 0


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to