Users no longer need Python: run.bat or install_autostart.ps1; agent reconnects when CYD is plugged in.
16 lines
591 B
PowerShell
16 lines
591 B
PowerShell
$ErrorActionPreference = "Stop"
|
|
$startup = [Environment]::GetFolderPath("Startup")
|
|
$lnkPath = Join-Path $startup "CYD-ServerInfo.lnk"
|
|
if (Test-Path $lnkPath) {
|
|
Remove-Item $lnkPath -Force
|
|
Write-Host "Removed: $lnkPath"
|
|
} else {
|
|
Write-Host "No Startup shortcut found."
|
|
}
|
|
Get-CimInstance Win32_Process -ErrorAction SilentlyContinue |
|
|
Where-Object { $_.Name -match 'send_sysinfo' -or ($_.CommandLine -and $_.CommandLine -match 'send_sysinfo') } |
|
|
ForEach-Object {
|
|
Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue
|
|
Write-Host "Stopped PID $($_.ProcessId)"
|
|
}
|