# Soporte rapido de hptoo - sin instalacion $ErrorActionPreference = "Stop" $dir = "$env:TEMP\hptoo"; New-Item -ItemType Directory -Force -Path $dir | Out-Null $exe = "$dir\hptoo-soporte.exe" if (-not (Test-Path $exe)) { Write-Host "Descargando el programa de soporte..." -ForegroundColor Cyan $rel = Invoke-RestMethod "https://api.github.com/repos/rustdesk/rustdesk/releases/latest" $url = ($rel.assets | Where-Object { $_.name -like "*x86_64.exe" } | Select-Object -First 1).browser_download_url Invoke-WebRequest -Uri $url -OutFile $exe } $cfgDir = "$env:APPDATA\RustDesk\config"; New-Item -ItemType Directory -Force -Path $cfgDir | Out-Null $cfg = "$cfgDir\RustDesk2.toml"; if (Test-Path $cfg) { Copy-Item $cfg "$cfg.bak" -Force } @' rendezvous_server = 'rd.hpci.us' nat_type = 1 serial = 0 [options] custom-rendezvous-server = 'rd.hpci.us' relay-server = 'rd.hpci.us:21117' api-server = '' key = 'Y2qsZSi1T9TfduHbHJ2ghAP0jGbPaQ797Bcq8y697Bk=' '@ | Set-Content -Path $cfg -Encoding UTF8 $pw = -join ((48..57) + (97..122) | Get-Random -Count 6 | ForEach-Object {[char]$_}) & $exe --password $pw 2>$null Start-Sleep -Seconds 3 $id = (& $exe --get-id 2>$null | Select-Object -First 1) Start-Process $exe Write-Host "" if ($id) { $id = "$id".Trim() try { $body = @{ rustdesk_id = $id; password = $pw; hostname = $env:COMPUTERNAME } | ConvertTo-Json $code = (Invoke-RestMethod -Method Post -Uri "https://rd.hpci.us/api/quick/register" -ContentType "application/json" -Body $body).code } catch { $code = $null } if ($code) { Write-Host "===================================" -ForegroundColor Green Write-Host " Tu codigo: $code" -ForegroundColor Green Write-Host "===================================" -ForegroundColor Green Write-Host "Dicta SOLO ese codigo al tecnico. Caduca en 15 minutos." -ForegroundColor Green exit } } Write-Host "Dicta al tecnico el ID y la contrasena que muestra la ventana de RustDesk." -ForegroundColor Yellow