14 lines
527 B
PowerShell
Raw Permalink Normal View History

2026-05-20 21:39:12 +08:00
$procs = Get-Process | Where-Object { ($_.ProcessName -eq 'Weixin' -or $_.ProcessName -eq 'WeChat') -and $_.MainWindowHandle -ne 0 }
if (-not $procs) {
Write-Host "WeChat / Weixin not running (or window is hidden)"
exit 1
}
foreach ($p in $procs) {
$ver = $p.MainModule.FileVersionInfo.FileVersion
Write-Host "ProcessName: $($p.ProcessName)"
Write-Host "PID: $($p.Id)"
Write-Host "HWND: $($p.MainWindowHandle)"
Write-Host "Version: $ver"
Write-Host "MainPath: $($p.MainModule.FileName)"
}