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.
This commit is contained in:
15
host/uninstall_autostart.ps1
Normal file
15
host/uninstall_autostart.ps1
Normal file
@@ -0,0 +1,15 @@
|
||||
$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)"
|
||||
}
|
||||
Reference in New Issue
Block a user