Files
serverinfotest/host/uninstall_autostart.ps1
DESKTOP-PUHFO60\dsx2016 f83df3fd39 Ship Windows plug-and-play host exe with USB wait and autostart.
Users no longer need Python: run.bat or install_autostart.ps1; agent reconnects when CYD is plugged in.
2026-10-27 20:23:57 +08:00

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)"
}