Files

4 lines
289 B
PowerShell
Raw Permalink Normal View History

# 统计正在运行的 自动重启DSH.bat 守护窗口数量(防重复判断用)
$n = (Get-CimInstance Win32_Process -Filter "Name='cmd.exe'" -ErrorAction SilentlyContinue).Where({ $_.CommandLine -match '自动重启DSH\.bat' }).Count
if ($null -eq $n) { $n = 0 }
Write-Output $n