Add persistent desktop supervisor for ERP Local Agent
This commit is contained in:
@@ -1,2 +1,4 @@
|
||||
@echo off
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Stop-ScheduledTask -TaskName 'ERP Local Agent'"
|
||||
@echo off
|
||||
setlocal
|
||||
set "AGENT_DIR=%~dp0"
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Stop-ScheduledTask -TaskName 'ERP Local Agent' -ErrorAction SilentlyContinue; $root=$env:AGENT_DIR.TrimEnd('\'); Get-CimInstance Win32_Process -ErrorAction SilentlyContinue | Where-Object { $_.CommandLine -and (($_.CommandLine -match 'ERPAgentSupervisor\.pyw') -or ($_.CommandLine -match 'erp_local_agent\.main')) -and $_.CommandLine -like ('*'+$root+'*') } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue }"
|
||||
|
||||
Reference in New Issue
Block a user