@echo off rem chktime - stop the running server (python/pythonw running chktime.py) powershell -NoProfile -ExecutionPolicy Bypass -Command "$p = @(Get-CimInstance Win32_Process | Where-Object { $_.Name -like 'python*' -and $_.CommandLine -like '*chktime.py*' }); if ($p.Count) { $p | ForEach-Object { Stop-Process -Id $_.ProcessId -Force }; Write-Host ('chktime stopped (' + $p.Count + ' process)') } else { Write-Host 'chktime is not running' }; Start-Sleep -Seconds 2"